groston
08-26-2010, 09:47 PM
I have a MS Word application which uses a DSN-less connection to access a remote SQL database. (See details below.) When I last used this application a year ago (on a XP Pro machine with Office 2003), it ran fine. The exact same application no longer runs - its give the following error:
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.
I have tried this application on three machines: Win7 x64/Office 2010 (32 bit); XP Pro/Office 2003; and XP Pro/Office 2007 and have gotten the same error each time.
Here is the relevant code:
Dim cn As ADODB.Connection
Dim cmd As ADODB.Command
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
cn.ConnectionString = "Driver={SQL Native Client};Server=<ip_address>;Database=<db>;Uid=<uid>;Pwd=<pwd>"
cn.CursorLocation = adUseClient
cn.Open
Set cmd = New ADODB.Command
Set cmd.ActiveConnection = cn
cmd.CommandText = "sp_name"
cmd.CommandType = adCmdStoredProc
cmd.Parameters.Append cmd.CreateParameter("@Param", adChar, adParamInput, 25, "Value")
Set rs = cmd.Execute
Since the application did not change - the date stamp on the .doc file is last August - I do not know what to look for in order to resolve the problem. Can anyone please suggest an approach?
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.
I have tried this application on three machines: Win7 x64/Office 2010 (32 bit); XP Pro/Office 2003; and XP Pro/Office 2007 and have gotten the same error each time.
Here is the relevant code:
Dim cn As ADODB.Connection
Dim cmd As ADODB.Command
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
cn.ConnectionString = "Driver={SQL Native Client};Server=<ip_address>;Database=<db>;Uid=<uid>;Pwd=<pwd>"
cn.CursorLocation = adUseClient
cn.Open
Set cmd = New ADODB.Command
Set cmd.ActiveConnection = cn
cmd.CommandText = "sp_name"
cmd.CommandType = adCmdStoredProc
cmd.Parameters.Append cmd.CreateParameter("@Param", adChar, adParamInput, 25, "Value")
Set rs = cmd.Execute
Since the application did not change - the date stamp on the .doc file is last August - I do not know what to look for in order to resolve the problem. Can anyone please suggest an approach?