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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access -- >SQL Provider Syntax

Status
Not open for further replies.

jurgen

Programmer
Feb 8, 2001
209
0
0
BE
Hi,

Does someone can help me, what's the syntax for a connection in Access Project File to the database with a known username and password that is the same for every user.

rst.open .......


thankx a lot

JJ
 
SQL Server 7 or 2000 ???

' ---------- DSN less ------------------
Dim Conn As ADODB.Connection
Dim Rs1 As ADODB.Recordset

Set Conn = New ADODB.Connection
Set Rs1 = New ADODB.Recordset

Conn.Open "driver=SQL Server;server=yourSQLdatabase;uid=sa;pwd=;database=yourdatabase;"
Dim SQLCode As String
SQLCode = "Select ....."

Rs1.Open SQLCode, Conn, adOpenStatic, adLockOptimistic

'Do some stuff with the recordset

Set Rs1 = Nothing
Set Conn = Nothing
'''
I use this everywhere.
DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
This is just what I have been looking for also. Thanks guys
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top