Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 ADO DSN-less connection to SQL Server 7

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
I want to use a DSN less connection to connect to our SQL server Database.

I have done this in VB Script ASP but the dialect is slightly different in VB 6.

here is my code: in VB6
Dim Conn As Object
Dim Rs1 As New ADODB.Recordset

Set Conn = server.CreateObject("ADODB.Connection")
Conn.Open "driver=SQL Server;server=smallbserver;uid=sa;pwd=;database=Universal;"
Set Rs1 = Conn.Execute("SELECT [EmployeeID], [FirstName], [LastName] FROM Personnel Where [EmployeeID] = '" & EmpID1 & "'")

I get an error "Object required" on the "Set Conn = "
line.

TIA
 
Doug,

These is none of this "server" stuff in VB. You need to code the

Dim Conn As Object

as

Dim Conn As ADODB.Connection

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top