HI.
How can I pass user_name and password using ODBC connection to the Informix database and MS Acceess 2000 as a front end application?
Thanks in advance.
You can use ADO methods to establish connection to your Informix database
Step 1: Assuming you have ODBC drivers setup for Informix on your system, define a System DSN. For our purposes here, we'll call your new DSN "MyInformix"
Step 2: Either in a module or the form that you wish to have accessing the Informix datasource, write the following function:
Public Sub getInformixData()
Dim Cnxn As ADODB.Connection
Dim rstMyTargetTable As ADODB.Recordset
Dim strSQLTarget As String
' Open a connection using a DSN and OLE DB tags
Set Cnxn = New ADODB.Connection
Cnxn.ConnectionString = "Data Source=MyInformix;User ID=sa;Password=pwd;"
Cnxn.Open
' Open Target Table
Set rstMyTargetTable = New ADODB.Recordset
strSQLTarget = "Insert Your Query Here"
rstMyTargetTable.Open strSQLTarget, Cnxn, adOpenKeyset, adLockOptimistic, adCmdTable
'you would do any manipulation of the data set here
'
'
rstMyTargetTable.Close
Cnxn.Close
Set rstMyTargetTable = Nothing
Set Cnxn = Nothing
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.