ขอคำแนะนำหน่อยค่ะ
กระทู้เก่าบอร์ด อ.สุภาพ ไชยา

 264   4
URL.หัวข้อ / URL
ขอคำแนะนำหน่อยค่ะ

ลองทำตามที่แนะนำใน  http://agserver.kku.ac.th/basiceng/webboard/Question.asp?GID=269 เรื่องการนำเข้า text file น่ะค่ะ มันขึ้น error ว่า User-defined type not defined น่ะค่ะ ต้องทำยังไงคะ เพิ่งหัดเขียนด้วยน่ะค่ะ อาจจะไม่ค่อยรู้เรื่องเท่าไหร่ ขอบคุณค่ะ

4 Reply in this Topic. Dispaly 1 pages and you are on page number 1

1 @R01568
ขอดูโค้ดที่ใช้หน่อยครับ
2 @R01575
Private Sub Command78_Click() Dim dbs As Database Dim tdfSales As TableDef Dim rstSales As Recordset ' Open the Microsoft Access database. Set dbs = CurrentDb ' Create a TableDef object. Set tdfSales = dbs.CreateTableDef("Linked Text Table") ' Set the connection string to specify the source database type and ' the full path to the file that contains the table you want to link. tdfSales.Connect = "Text;" _ & "DATABASE=C:\Database" ' Set the SourceTableName property to the name of the table you want to access. tdfSales.SourceTableName = "Abc.txt" ' Append the TableDef object to the TableDefs collection to create a link. dbs.TableDefs.Append tdfSales End Sub Áѹ¢Öé¹á¶º error µÑé§áµèºÃ÷Ѵáá·Õè»ÃСÒȵÑÇá»ÃàÅÂÍèФèÐ
3 @R01576
ถ้าใช้ Access 2000 หรือสูงกว่า ผมเดาว่าน่าจะเกิดจาก DAO ซึ่งยังไม่ได้เลือกไว้ใน References ให้ไปที่เมนู Tools>References แล้วดูว่ามี Microsoft DAO 3.6 Object Library เลือกไว้หรือยัง ถ้ายังให้ค้นหา แล้วเลือกไว้ แล้วเปลี่ยนโค้ดจาก Dim dbs As Database Dim tdfSales As TableDef ไปเป็น Dim dbs As DAO.Database Dim tdfSales As DAO.TableDef
4 @R01579
ได้แล้วค่ะ ขอบคุณค่ะ
@ ประกาศใช้งานเว็บบอร์ดใหม่ => บอร์ดเรียนรู้ Access สำหรับคนไทย
แล้วจะใส่ลิ้งอ้างอิงมาที่โพสต์เก่านี้หรือไม่ก็ตามสะดวกครับ
Time: 0.0543s