Problem Connecting to MSSQL2000 from VB6 via ODBC
From: Andy (andy_at_newlinecomputing.com)
Date: 10/06/04
- Previous message: Steve Thompson: "Re: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection"
- Next in thread: Sue Hoegemeier: "Re: Problem Connecting to MSSQL2000 from VB6 via ODBC"
- Reply: Sue Hoegemeier: "Re: Problem Connecting to MSSQL2000 from VB6 via ODBC"
- Messages sorted by: [ date ] [ thread ]
Date: 6 Oct 2004 09:14:45 -0700
Please can somebody help me.
I am developing a VB6 application connecting to a SQL Server 2000
database,
which at the moment is on my local machine.
The code below loooks as though it should work but when I get
to the openconnection statement I get a runtime error 13 "Type
Mismatch"
and the connection to the databse fails.
My ODBC driver is setup correctly, as is the permissions on the sql
server itself.
Can anybody see what I am doing wrong.
thanks in advance
Option Explicit
Private Sub getdata_Click()
Dim wspodbc As Workspace
Dim conNewConnection As Connection
Dim rstodbc As Recordset
Dim wrkspc As String
wrkspc = "ODBCWRK"
Set wspodbc = dbengine.createworkspace(wrkspc, "name", "password",
dbuseodbc)
Set conNewConnection = wspodbc.OpenConnection("connection1",
dbDriverComplete, False, _
"ODBC;database=DB1;UID=name;PWD=password;DSN=DBCONN1")
End Sub
- Previous message: Steve Thompson: "Re: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection"
- Next in thread: Sue Hoegemeier: "Re: Problem Connecting to MSSQL2000 from VB6 via ODBC"
- Reply: Sue Hoegemeier: "Re: Problem Connecting to MSSQL2000 from VB6 via ODBC"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|