how to code ODBC connection to server's databse

icedtea97
04-18-2004, 12:53 PM
hello everybody,
i'm using an ODBC connection. i have create a DSN database in the server.
the problem i'm facing now is, i can't connect to the server's database through client application.

my connection for server is like this:
Dim conn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rs As New ADODB.Recordset

conn.Open "DSN=Test;uid=;pwd=;database=my.mdb"
Set cmd.ActiveConnection = conn
strSQL = "INSERT INTO original_table([name], age,[subject]) VALUES ('" & Replace$(name, " '", "' '") & "' , '" & age & "' , '" & Replace$(subject, " '", "' '") & "' ) "
cmd.CommandText = strSQL

rs.CursorLocation = adUseClient
rs.Open cmd, , adOpenStatic, adLockBatchOptimistic


how do i chnange the code in order to connect to the server's database through client application?

thanks,
icedtea97

Shurik12
04-18-2004, 01:07 PM
Hi,

What error are you receiving?

Shurik.

icedtea97
04-18-2004, 01:18 PM
Hi,

What error are you receiving?

Shurik.
the error i get:
Run time error '-2147467259(80004005)'
[Microsoft][ODBC Manager] Data source name not found and no default driver specified

Shurik12
04-18-2004, 04:20 PM
Well if I understand the problem correctly then you have to create the DSN on your client machine.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum