Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ODBC Conenction Programmatically
Hey guys
Using ODBC, it is possible to set up a connection to a database. Instead of having to do this manually for multiple computers, I would like to be able to run a code that will do it automatically. For instance if I wanted to setup a database connection to file C:\test.mdb, I would open up the ODBC managaer and then type in a description, navigate to the source, etc.. How do I write code that will set up a system database connection to a file called test.mdb located on C:\? Thanks Todd Huttenstine |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
ODBC Conenction Programmatically
Turn on the macro recorder and do it manually. Then turn it off and look at
the code. -- Regards, Tom Ogilvy "Todd Huttenstine" wrote in message ... Hey guys Using ODBC, it is possible to set up a connection to a database. Instead of having to do this manually for multiple computers, I would like to be able to run a code that will do it automatically. For instance if I wanted to setup a database connection to file C:\test.mdb, I would open up the ODBC managaer and then type in a description, navigate to the source, etc.. How do I write code that will set up a system database connection to a file called test.mdb located on C:\? Thanks Todd Huttenstine |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
ODBC Conenction Programmatically
How can you access the ODBC manager from within Excel? I
dont think you can... -----Original Message----- Turn on the macro recorder and do it manually. Then turn it off and look at the code. -- Regards, Tom Ogilvy "Todd Huttenstine" wrote in message ... Hey guys Using ODBC, it is possible to set up a connection to a database. Instead of having to do this manually for multiple computers, I would like to be able to run a code that will do it automatically. For instance if I wanted to setup a database connection to file C:\test.mdb, I would open up the ODBC managaer and then type in a description, navigate to the source, etc.. How do I write code that will set up a system database connection to a file called test.mdb located on C:\? Thanks Todd Huttenstine . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
ODBC Conenction Programmatically
Data=Get External Data
or Data = Import External Data Depending on version of Excel. -- Regards, Tom Ogilvy "Todd Huttenstine" wrote in message ... How can you access the ODBC manager from within Excel? I dont think you can... -----Original Message----- Turn on the macro recorder and do it manually. Then turn it off and look at the code. -- Regards, Tom Ogilvy "Todd Huttenstine" wrote in message ... Hey guys Using ODBC, it is possible to set up a connection to a database. Instead of having to do this manually for multiple computers, I would like to be able to run a code that will do it automatically. For instance if I wanted to setup a database connection to file C:\test.mdb, I would open up the ODBC managaer and then type in a description, navigate to the source, etc.. How do I write code that will set up a system database connection to a file called test.mdb located on C:\? Thanks Todd Huttenstine . |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
ODBC Conenction Programmatically
Todd,
You can use the prompt against the ODBC provider for OLEDB. Set con = New ADODB.Connection con.ConnectionString = ConnectionString con.Provider = "MSDASQL" con.Properties("Prompt") = adPromptAlways con.Open str = con.Properties("Extended Properties") This is the code I use in the Query Editor on my website. -- Rob van Gelder - http://www.vangelder.co.nz/excel -----Original Message----- From: Todd Huttenstine ] Posted At: Friday, 31 December 2004 5:33 a.m. Posted To: microsoft.public.excel.programming Conversation: ODBC Conenction Programmatically Subject: ODBC Conenction Programmatically Hey guys Using ODBC, it is possible to set up a connection to a database. Instead of having to do this manually for multiple computers, I would like to be able to run a code that will do it automatically. For instance if I wanted to setup a database connection to file C:\test.mdb, I would open up the ODBC managaer and then type in a description, navigate to the source, etc.. How do I write code that will set up a system database connection to a file called test.mdb located on C:\? Thanks Todd Huttenstine |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to programmatically fix row and column | Excel Programming | |||
Changing DSN programmatically? | Excel Programming | |||
delete row programmatically | Excel Programming | |||
Programmatically Add Reference` | Excel Programming | |||
Can i set a reference programmatically? | Excel Programming |