473,498 Members | 1,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating a database connection and recordset

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
1 2794
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2088
by: BP | last post by:
I get the following error: Error Type: Microsoft VBScript runtime (0x800A01A8) Object required: '' /myweb4/authorised_user_page.asp, line 70 and line 70 of my code is: <% rsCheckUser1.Open...
0
2549
by: billmiami2 | last post by:
Perhaps many of you MS Access fanatics already know this, but it seems that stored procedures and views are possible in Jet. I thought I would leave this message just in case it would help anyone....
2
4415
by: Jozef | last post by:
Hello, I'm trying to create a central function that runs a connection to an SQL Server database. The connection etc works, but when I try to call it, I get an error saying "Runtime-Error 91:...
44
4484
by: Greg Strong | last post by:
Hello All, Is it better to create a query in DAO where a report has 4 sub-reports each of whose record source is a query created at runtime and everything is in 1 MDB file? From what I've...
1
4722
by: dave | last post by:
I'm classic ASP developer and trying to switch to .net ...I'm newbie to ..net... In classic ASP for ADO connectivity i used to put below code in one separate file and used to include that file...
3
2633
by: Bhavsan | last post by:
Here is what I am trying to do. Kindly, help me. 1. I'm creating a query dynamically based on User input using VBA (strSQL and DotSQL in the code below) 2. Executing the created query with in VBA...
3
2241
by: emajka21 | last post by:
Hello, and thank you in advance for trying to help me. I am trying to create an access 2000 form without using the wizard. It just doesn't seem like I can the level of complexity I want out of the...
3
1643
by: Ninio | last post by:
i would like to know how to query a database so that if a category from the dropdown menu is selected it will display all the records found on the table. thank you very much. Here is the table from...
3
2256
by: smugcool | last post by:
Hi, I have created a form in Visual basic 6.0 for adding/updating the change request made by various users. Well i am able to update the record through my code in access database. Can anyone...
0
7005
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5465
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4916
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4595
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
293
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.