|
-
Sep 24th, 2007, 08:48 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] Query result container not for display
Hi All,
Here's the problem : I'am building a vb6 application that uses a .dll wrapper for sqlite to access two sqlite database. My query results (SELECT) are returned in a Variant variable. I would like to add my result to an organized object like a recordset or a datagrid BUT I dont want to display the results. I am building a class not a form, so what I'm really looking for is an object in wich I could initiate columns with proper column name and then add my data rows. That way I will be able to browse my result using the row index and the field name.
Is there an unbound object that doesn't have to be on a form that I could use?
thanks a lot for your help
-
Sep 24th, 2007, 09:29 AM
#2
Re: Query result container not for display
Welcome to VBForums 
Thread moved to Database Development forum
The Recordset object is not bound at all - I suspect that you have been using a Data Control of some sort, perhaps the DAO one (default name of 'Data1') or the ADO one (default name of 'ADODC1'), both of which include a Recordset.
In the "ADO Tutorial" link in my signature is an explanation/example of how to use a Recordset without binding - there is code to show the data, but you can change that to whatever you like.
-
Sep 24th, 2007, 09:40 AM
#3
Re: Query result container not for display
As far as display the data, you would need some kind of control, and that control would have to reside on a form.
Wouldn't even a bound data control need to reside on a form?
-
Sep 24th, 2007, 09:48 AM
#4
Thread Starter
Fanatic Member
Re: Query result container not for display
thanks for the tutorial, but I still see a problem. the recordset needs a connection to a database to get the structure of the table and I don't have any connection object as I am using a .dll wrapper to connect to the sqlite database. So in order to use the recordset I need to be able to give the recordset the proper structure, I would need something like : rs.addheaders("field1", "field2"). then I would be able to use the AddNew method.
I hope this is clearer.
thanks for helping
-
Sep 24th, 2007, 10:13 AM
#5
Re: Query result container not for display
I would need something like : rs.addheaders("field1", "field2"). then I would be able to use the AddNew method.
You can create an in-memory recordset using the Fields.Append method
Code:
Dim rs as ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Fields.Append "Field1", adInteger
rs.Fields.Append "Field1", advarchar, 30
rs.Open
rs.AddNew...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|