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

Single ODBC connection with multiple pass throughs

Status
Not open for further replies.

WILLIEWANKA

Technical User
May 22, 2003
42
US
I'm trying to create a GUI for business users to create reports using Teradata as the database.

It will use a series of pass through queries to create the tables need for the final report. I've gotten the interface set up to select the required tables and create the pass through queries. The only problem I am running into is whenever I begin to run the pass through queries the ODBC dialog box will pop up for each query (there are about 5 total). Is there any way for me to open a DSN connection through ODBC, then trap that connection string and pass it on to each of the pass throughs when they are created? I know how to add
Code:
qdf.connectionstring ("DSN=blah"yadda yadda yadda)
But I just can't find out how to get that dialog to pop up to create that first connection string. Any ideas? Here's the code to change the pass through queries. I've got a function to see if the query exists (ffindquery), if it does then it changes the sql, if not, it creates the query.

Code:
Private Function changequery(qryname As String, strSQL As String)

Dim db As Database
Dim qdf As QueryDef

Set db = CurrentDb

If ffindQuery(qryname) = True Then
Set qdf = db.QueryDefs(qryname)
Else
Set qdf = db.CreateQueryDef(qryname)
End If

qdf.SQL = strSQL
Code:
'qdf.connectionstring ("ODBC;DSN=mydsn;UID=myuser;PWD=mypwd;") this is where I need to get the connection string
Code:
qdf.Close

Set qdf = Nothing
Set db = Nothing

End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top