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

Linking tables in a Runtime Access application

Status
Not open for further replies.

behbeh

Programmer
Mar 10, 2001
48
US
I have an Access 2000 database (MDB) that needs to be linked somehow to a SQL Server 7.0 database. I can manually create the links within the development environment, however, I need to create the database into a runtime application. If the DSN is the same for all the endusers, will this work???? ANy other ideas how I can dynamically link the tables at runtime?
 
Answer to first part.
Yes I have a lot of programs that use the Exact same DSN setup on differnt machines.
Also look at a DSN less connection ADO so you don't have to create a DSN at all.
Here are two examples I had used before

' ---------- 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=smallbserver;uid=sa;pwd=;database=Universal;"
Dim SQLCode As String
SQLCode = "Select Max(PURCH_ORDER) AS LastPO From PO"

Rs1.Open SQLCode, Conn, adOpenStatic, adLockOptimistic

'Do some stuff with the recordset

Rs1.Close
Conn.Close
Set Rs1 = Nothing
Set Conn = Nothing

-----------------------------
' SQL connections
Dim Conn As ADODB.Connection
Dim MyTransSQL As ADODB.Recordset

Set Conn = New ADODB.Connection
Set MyTransSQL = New ADODB.Recordset
Conn.Open "driver=SQL Server;server=smallbserver;uid=sa;pwd=;database=Universal;" DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top