By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,551 Members | 2,741 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,551 IT Pros & Developers. It's quick & easy.

Creating a database connection and recordset

P: n/a
Hi !

I have an SQL query which im developing on the click of a command
button on a form.

but am stuck up in creating a recordset of that query.
how should one connect to database? use adodb or dao connection? are
there any particular setting reqd in vb editor?
what will be the syntax for connecting to a databse?
what shud be the syntax for opening my query in a recordset?

if i say
dim db as dao.database
dim rs as adodb.recordset
or
dim db as adodb.database
dim rs as adodb.recordset
i get an error message saying "object not defined" ???

also ... can i pass a recordset variable to another form or report?
can a recordset created in one form be accessed in some other
form/report?

please help. this is kind a urgent... !
thanks in advance
pragati
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
If you use a DAO database object, you need to use a DAO Recordset. If you
want to use an ADO Recordset, you must use an ADO Connection. ADO does not
have a "Database" object.

On 29 Dec 2003 00:58:43 -0800, pr**********@yahoo.com (Pragati) wrote:
Hi !

I have an SQL query which im developing on the click of a command
button on a form.

but am stuck up in creating a recordset of that query.
how should one connect to database? use adodb or dao connection? are
there any particular setting reqd in vb editor?
what will be the syntax for connecting to a databse?
what shud be the syntax for opening my query in a recordset?

if i say
dim db as dao.database
dim rs as adodb.recordset
or
dim db as adodb.database
dim rs as adodb.recordset
i get an error message saying "object not defined" ???

also ... can i pass a recordset variable to another form or report?
can a recordset created in one form be accessed in some other
form/report?

please help. this is kind a urgent... !
thanks in advance
pragati


Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.