I have a new project that will involve pulling data from tables in SQL server. Any information that will make this process efficient would be appreciated.
Use ADO
Download MDAC 2.5 (Microsoft Data Access Control) from Microsofts WEB site, which is the new ODBC drivers for SQL.
the file name is "mdac_typ.exe" which is ~7.5 meg.
this must be loaded on each computer that will read the SQL database.
here is a snippet of Access '97 code to open a SQL 7 database using ADO-db
' SQL connections
Dim Conn As ADODB.Connection
Dim MyTransSQL As ADODB.Recordset
Dim SQLcode As String
Set Conn = New ADODB.Connection
Set MyTransSQL = New ADODB.Recordset
Conn.Open "driver=SQL Server;server=smallbserver;uid=sa;pwd=;database=Universal;"
SQLcode = "INSERT INTO TransLog (LogInfo) VALUES (N'" & WhattoAdd & " Date > " & Format$(Now, "ddd mm/dd/yy" & " " & Format(Now, "hh:nn:ss" & "')"
MyTransSQL.Open SQLcode, Conn, adOpenStatic, adLockOptimistic
I am fortunate that I have the SQL server setting right next to my developement PC. So I use the Enterprise Manager in the Server and let it build the correct SQL synatax.
In my example I an Inserting a value column name "LogInfo" in a table called "TransLog" .
DougP, MCP
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.