Solved

Creating ODBC driver database

Posted on 1998-07-15
2
174 Views
Last Modified: 2012-05-04
I am looking for code to create an ODBC database.  I do not want to create a database and then go into Control Panel in Windows to create an ODBC connection.  I need a way to create a database and then create ODBC connection within  code.   I know how to create a non-ODBC database, but I need to make an ODBC connection to MS Access in code.
0
Comment
Question by:newyorker
2 Comments
 
LVL 2

Accepted Solution

by:
seahpc earned 100 total points
ID: 1465845
Try this

Public m_rdoConn As rdoConnection
Public m_rdoErr As rdoError
Public m_rdoResult As rdoResultset
Public m_rdoEnv As rdoEnvironment
Public m_rdoCol As rdoColumn

Set m_rdoEnv = rdoEnvironments(0)
Set m_rdoConn = m_rdoEnv.OpenConnection(dsname:="", _
                prompt:=rdDriverComplete, _
                Connect:="uid=sa;pwd=zaq12wsx;driver={SQL Server};" _
                & "server=Auc_s2_Central;database=Auction;")
0
 
LVL 1

Expert Comment

by:JayMerritt
ID: 1465846
FYI - This is called a DSN-LESS connection.  It does not require an ODBC entry.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question