Hi, i am using VB6 with Access databse after a long time and have forgotten some syntax.
I am using ADODC connection (the dirty method) wherein one makes a connection using ADODC component and setting its properties (ODBC and selecting table/ query).
I need to display the fields of a recordset in the form where the field value is given in the text1.text.
I remember vaugely that we used expressions like
Dim str as String
str =" SELECT * FROM paybook WHERE paybook.Field(0) = '"&text1.text&"'"
thereafter how to use this i am ot remembering
Need your help on this please
regards

Recommended Answers

All 3 Replies

Use

Connection.Execute SQLQueryString

to Execute the Query.

Dim str as String
str =" SELECT * FROM paybook WHERE paybook.Field(0) = '"&text1.text&"'"
Connection1.Execute str

Use

Connection.Execute SQLQueryString

to Execute the Query.

Dim str as String
str =" SELECT * FROM paybook WHERE paybook.Field(0) = '"&text1.text&"'"
Connection1.Execute str

Thanks. But my misery is not yet over. How do i link these selected records to sat a datagrid or display in a text box.
regards

Hi,
>First Open a Connection

>Open a recordset with your SQL String

>Set DataSource of Data Grid to the Recordset

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.