Hi
I have a form with 3text controls.
Text1
Text2
Text3
I want to populate these texts with data from an ODBC source.
The data is a small table holding no more than 30 records of:
SiteCD ( Current Branch )
UserID ( Current User )
JobID ( Current Job I am Working On )
Without using any components adodc etc, can I populate these Text Controls?
( This is a start to a new login form for my project )
Connection - ODBC
-
- SilverLounger
- Posts: 1728
- Joined: 25 Jan 2010, 08:34
- Location: Stoke on Trent - Staffordshire - England
Connection - ODBC
Cheers ...
Dave.
Dave.
-
- Administrator
- Posts: 79365
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Connection - ODBC
You can set a reference to one of the Microsoft ActiveX Data Objects m.n libraries, and open an ADODB connection and an ADODB recordset. You can then set the value of the text boxes to the value of fields in the recordset. Don't forget to close the recordset and connection when you don't need them anymore.
See ADO Connection String Samples or The Connection String Reference for examples of the connection string you need to open an ADODB connection to various kinds of data sources.
See ADO Connection String Samples or The Connection String Reference for examples of the connection string you need to open an ADODB connection to various kinds of data sources.
Best wishes,
Hans
Hans
-
- SilverLounger
- Posts: 1728
- Joined: 25 Jan 2010, 08:34
- Location: Stoke on Trent - Staffordshire - England