Access query

nikini
11-10-2005, 03:51 PM
I want to make a program this way: I click a button and the input box comes.. i write the sql select command and it adds a query named "vb" in the file "test.mdb".
How to add a query from vb?? Help me! I use visual basic 6 with service pack 6..:D any ideas?? anyone?

NateO
11-10-2005, 05:14 PM
Hello,

It says here (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odeopg/html/deovrcreatingmodifyingstoredqueries.asp) that you'll be using DAO for this, so, see the following (first procedure):

http://msdn.microsoft.com/archive/en-us/office97/html/output/F1/D2/S5A2E0.asp

How to access a DB with DAO you ask? See the following:

http://www.xtremevbtalk.com/showthread.php?p=1034904

nikini
11-11-2005, 01:41 AM
THANKS A LOT!!! Everything is super cool..:D Love u dude..:D

nikini
11-11-2005, 03:34 AM
But how do i make another table with same fields.. and with the records of the query?
I tried the "SELECT IN" but it dosn't work in VB!

NateO
11-11-2005, 09:55 AM
Hello again,

Sorry, you lost me on Select in. Let's back up here. What is you want to do? Return a recordset? Write to a DB? Make a table?

If it's the former, no need to mess with making queries or tables. The last link in my first post shows how to pull up a DAO recordset.

nikini
11-13-2005, 04:09 AM
never mind.. i did it..:D it was select into..:D
Although a new problem has appeared.. in the example from msdn.. it's a good procedure but i don't have the object database..:D why? i added an ado data component.. what else?

italkid
11-13-2005, 10:05 AM
Although a new problem has appeared..
And that is...? :confused:

NateO
11-13-2005, 03:41 PM
in the example from msdn.. it's a good procedure but i don't have the object database..:D why? i added an ado data component.. what else?
It was a DAO example? If you're using DAO, set up a reference for MS DAO. :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum