About ODBC Data Source 32 bits

I used ODBC to make a link to the MS Access Database.
Is there possible to create a vb program that will do this for me, instead of going to the control panel ?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Actually the easier way would be to use a DSNles connection...This way you can let others use the program with a centralized DB without the need to create a DSN on each Machine... a sample connection sting appears below...

connString = "Provider = SQLOLEDB;Data source = mySQLServer;Initial Catalog = someDataBase;user id= someUser;password= aPassword"

This of course is for a SQL server but it is the same syntax for an Access DB.

Check out the ADO objects for a further explanation...
tanc02Author Commented:
OK, but I think I still have to use ODBC to connect to the db right ?
In order to explain a little easier the following code walks through opening a connection setting up a command object with 3 parameters and calling a stored proceedure on a SQL server and putting the result set into a recordset that can be used. Then it cleans up. This little example can be run from any machine on the network and does not require any DSN defined on the machines...This is what a DSN-less connection is. No ODBC calls. ActiveX Data Objects only.

Set dbConn1 = New ADODB.Connection
Set dbComm = New ADODB.Command
Set dbRec = New ADODB.Recordset

Set cNodeParam1 = dbComm.CreateParameter(fldCNodeID, adInteger, adParamInput, 4)
    Set cNodeParam2 = dbComm.CreateParameter(fldCName, adVarChar, adParamInput, 50)
    Set cNodeParam3 = dbComm.CreateParameter(fldCDesc, adVarChar, adParamInput, 255)
    dbComme.Parameters.Append cNodeParam1
    dbComm.Parameters.Append cNodeParam2
    dbComm.Parameters.Append cNodeParam3

dbComm.Parameters(0) = nextCNodeId
    dbComm.Parameters(1) = lclCNodeName
    dbComm.Parameters(2) = lclCNodeDesc

With dbComm
    .ActiveConnection = dbConn1
    .CommandType = adCmdStoredProc
End With

set dbRec = dbComm.Execute

"DO Something with the recordset"

Set dbRec = Nothing
Set dbComm = Nothing
Set dbConn1 = Nothing

tanc02Author Commented:
mmpis :

Can you post your comments as answer, so I can award the points to you
Your wish is granted...I do hope that the walk through helped...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.