# there is errors:run-time error "3151",odbc-connection to 'yuan' failed

Posted by wen on September 15, 1998 at 16:02:33:

In Reply to: Re: I know can use RDO access remote database,but,I ask for you that how to use DAO ways access remote database posted by AadyLin on September 14, 1998 at 17:10:13:

program code as follows:
NT server machine name:internaldata
system dsn:yuan
in local machine :c:\db1.mdb
how to access remote NT server4.0 machine internaldata of database shareing directory
e:\db1.mdb,please help me?

Option Explicit
Dim dbwrk As Workspace
Dim dbase As Database
Dim localdbase As Database

Private Sub Form_Load()
Set dbwrk = CreateWorkspace("", "admin", "", dbUseJet)
Set dbase = dbwrk.OpenDatabase("", dbDriverNoPrompt, True, _
"odbc;dsn=yuan;uid=sa1;pwd=;database=db1;")
Set localdbase = dbwrk.OpenDatabase("c:\db1.mdb")
End Sub
error:odbc-connection to 'yuan' failed

Follow Ups: