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

How to stop the ODBC COnfigure Connection box from displaying?

Status
Not open for further replies.

Chucklez

Programmer
Jul 25, 2002
104
0
0
US
I am writing a data conversion in MS ACCESS that will allow the user, upon entering the first screen, to select a path where the source files are located at. Upon choosing this, the program automatically imports the needed data files (the table names are stored in a access table).

Here is my dilema:
Whenever a the VFP ODBC driver is used, it pops up a configure connection box. Whatever you enter into the box has no bearing on where the program retreives the data files. They are retreived from the location entered by the user upon entering the program.

Here is a example of sorts of what is currently happening.
1.)User enters program.
2.)User enters a path where the Source files are located (call the path A)
3.)User selects what module will be converted (this is accounting software)
4.)User presses the begin conversion command button
5.)A ODBC configure connection box is displayed prompting the user for the source path again
6.)User enters a source path (call the path B)
7.)The system imports in the datafiles.
8.)Conversion is processed

Now, if in step 6, you select a different path (B) than what you chose in step 2 (A), The ODBC connection still uses the path chosen in step 2 (A). This tells me I have the driver coded somewhat correctly.

What I want to do is keep the ODBC configure connection box from being displayed, thereby eliminating steps 5 & 6. The reason I dont want the box displayed is that there can be upwards of 50 tables imported in, and I dont want the user to enter in the path everytime.

Here is the coding I have for the import of the tables:
Code:
Dim strDBASE As String

strDBASE = pstrSourcePath & "\" & rstTables!TableName & pstrSourceComp & strHistory & ".dbf"
         
DoCmd.TransferDatabase acImport, "ODBC Database", _
     "ODBC;DSN=foxdsntrial;UID=User2;PWD=[URL unfurl="true"]www;LANGUAGE=us_english;"[/URL] _
     & "DATABASE=" & strDBASE & ";FILE NAME =" & rstTables!TableName & pstrSourceComp _
     & strHistory, , rstTables!TableName & pstrSourceComp & strHistory, "AM" & _
     rstTables!TableName & strHistory, 0, 1
rstTables = Acces table that holds the name of the imported tables
pstrSourcePath = Path the user ented in Step 2
pstrSourceComp = a 2 digit extension identifying what company the file belongs to
strHistory = "H" will be a history file; "" will be a current file

FOXDSNTRIAL is a trial ODBC driver that I created for this routine.

Can anyone PLEASE tell me how to do this? I am out of ideas, and at wits end. Any other questions, or if you would like me to zip down this .mdb and send it to you for you browsing, please post and I will answer promptly.
Thanks
-Chuck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top