Making sure the reference to DAO 3.6 is there...
กระทู้เก่าบอร์ด อ.สุภาพ ไชยา

 264   4
URL.หัวข้อ / URL
Making sure the reference to DAO 3.6 is there...

มีคนถามไว้ที่ 
http://www.utteraccess.com/forums/showflat.php?Cat=&Board=access_design&Number=114803&page=0&view=collapsed&sb=5&o=7&fpart=1&vc=1&PHPSESSID= 
 
ดังนี้ 
I've been having some trouble with my database--I've been trying to put it onto a CD so that we can distribute it to others. 
 
My first problem is that when I burn it to the CD it becomes a Read-Only file...I can probably make a batch file that will chang this easily. The next problem is that the reference to DAO 3.6 gets broken. For some reason, it's no longer checked. Even using it on the same machine that is was created on (copying to the CD, then back to a test folder) breaks the reference. 
 
I'm wondering if DAO 3.6 is *always* found here: 
C:\Program Files\Common Files\Microsoft Shared\DAO\dao360.dll 
 
If so, then anyone using my database with Access 2000 should be just fine. I thought about putting the dll in the same folder as the database, but I can't seem to get Access to find it. It works great if I tell it exactly where to look, but I don't know where the user will copy the database once I give it to them. Thanks in advance! 
 
~Jason 
 
ps..this is the code I've found in help that works if I use the full path to the dll: 
 
 
code:-------------------------------------------------------------------------------- 
Public Function ReferenceFromFile(strFileName As String) As Boolean 
    Dim ref As Reference 
        On Error GoTo Err_ReferenceFromFile 
        Set ref = References.AddFromFile(strFileName) 
    ReferenceFromFile = True 
 
    Exit_ReferenceFromFile: 
    Exit Function 
 
    Err_ReferenceFromFile: 
    MsgBox Err.Description 
    Resume Exit_ReferenceFromFile 
End Function 
 
        '** Function called from the AutoExec macro **' 
Public Function SetStartupProperties() As Boolean 
    ...more code... 
    If ReferenceFromFile _ 
        ("C:\Program Files\Common Files\Microsoft Shared\DAO\dao360.dll") _ 
        = True Then         
        MsgBox "reference set successfully" 
    Else 
        MsgBox "reference NOT set successfully" 
    End If 
    ...more code... 
End Function   
 
-------------------------------------------------------------------------------- 
 
Jason Tabert  
Student, University of Washington, Informatics   jrtabert@u.washington.edu'>
jrtabert@u.washington.edu  
 
เขาถามว่า จะให้ DAO คงอยู่ใน Reference ตลอดได้อย่างไร ซึ่งเขาเองมีโค้ดที่จะตั้ง DAO ให้อยู่ใน Reference อยู่แล้ว แต่จะเป็นแบบ Fix ห้องที่เก็บ DAO DLL จะทำอย่างไรที่จะไม่ Fix ได้บ้าง และจะแก้ไขปัญหา Read Only ของไฟล์ Access ที่เขียนลง CD แล้วนำไปเก็บใน Hard Disk จะให้ Read Only ออก จะทำอย่างไรดี 
 
ผมได้แนะนำเขาไป โดยการใช้ CurrentProject.Path เพราะเขาใช้ Access 2000 ซึ่งจะมีคำสั่งนี้อยู่ ดังนี้ 
 
code: 
-------------------------------------------------------------------------------- 
Public Function SetStartupProperties() As Boolean 
    ...more code... 
    If ReferenceFromFile _ 
        (CurrentProject.Path & "\dao360.dll") _ 
        = True Then 
        MsgBox "reference set successfully" 
    Else 
        MsgBox "reference NOT set successfully" 
    End If 
    ...more code... 
End Function 
-------------------------------------------------------------------------------- 
 
และใช้คำสั่งข้างล่างเปลี่ยน Read Only ของไฟล์เป้าหมายให้สามารถอ่านและเขียนได้ 
 
Sub FSetAttr() 
     SetAttr "d:\db1.mdb", vbNormal 
End Sub 
 
 
ส่วนที่ http://www.utteraccess.com/forums/showflat.php?Cat=&Board=AxxessXP&Number=114491&Forum=CatSearch-2&Words=TimK&Match=Username&Searchpage=0&Limit=25&Old=2weeks&Main=70489&Search=true#Post114491 จะพูดถึงปัญหา DAO DLL เหมือนกัน รวมถึง Object Library อื่นๆ ด้วย มักจะมีปัญหาตอนเขาโปรแกรมไปให้ user ใช้ 
 
ผมได้ให้คำแนะในการแก้ปัญหาไว้ด้วย ลองคลิกเข้าไปอ่านดูเองแล้วกันครับ 
 
 
 

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

1 @R00870
อ.สุภาพ ครับ รบกวนทำตัวอย่างด้วยครับ เห็นใน Code มี ...more code... ครับ ขอบพระคุณมากๆ ครับ Suchat ชลบุรี
2 @R00871
เป็นโค้ดของเจ้าของกระทู้ครับ เขาตัดออกตอนโพสต์แล้วครับ ผมเลยไม่รู้ว่ามีอะไรบ้าง
3 @R00885
ถ้าอยากรู้ว่าเราต้องมีอะไรใน Reference บ้าง ให้ดูบทความเกี่ยวกับเรื่องนี้ที่ http://support.microsoft.com/default.aspx?scid=kb;en-us;Q283115 ครับ พูดไว้ได้ละเอียดดี เป็นอย่างๆ ไป
4 @R00886
ถ้าจะดูของ Access 97 ก็ให้ไปอ่านได้ที่ http://support.microsoft.com/default.aspx?scid=kb;en-us;Q175484 ครับ
@ ประกาศใช้งานเว็บบอร์ดใหม่ => บอร์ดเรียนรู้ Access สำหรับคนไทย
แล้วจะใส่ลิ้งอ้างอิงมาที่โพสต์เก่านี้หรือไม่ก็ตามสะดวกครับ
Time: 0.0724s