[AccessD] HELP! Access97 passthrough query to SQL

Demulling Family demulling at centurytel.net
Wed Feb 4 19:59:46 CST 2004


>
>
>Jeanine,
>  
>

Here is some sample code from one of my applications:

Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim mysql As String

' Create a QueryDef object to retrieve data from a Microsoft SQL Server 
database.
Set db = DBEngine(0)(0)
Set qdf = db.CreateQueryDef("qryTemp")

With qdf
    .Connect = "ODBC;Description=<<Your Description Here>>;DRIVER=SQL 
Server;SERVER=<<Your Server Name Here>>;UID=<<Your User ID 
Here>>;PWD=<<Your Password Here;"
    .SQL = mysql 'Not that mysql is the sql to pass to the query def.
End With

db.QueryDefs.Refresh

Set qdf = Nothing
Set db = Nothing

> 
>
>  
>




More information about the AccessD mailing list