| | |
create a query in access from vb6
![]() |
•
•
Join Date: Oct 2005
Posts: 3
Reputation:
Solved Threads: 1
hi,
I need to create or replace a permanent query in access (like a view in oracle, postgres...), but from vb6 using ADODB.
i know that i can create and alter tables using a ADODB connection object with something like this
dim obj as new adodb.connection
...
...
obj.execute "create table ......:"
but, how to create the views?????
thanks
mstangeh
I need to create or replace a permanent query in access (like a view in oracle, postgres...), but from vb6 using ADODB.
i know that i can create and alter tables using a ADODB connection object with something like this
dim obj as new adodb.connection
...
...
obj.execute "create table ......:"
but, how to create the views?????
thanks
mstangeh
•
•
Join Date: Nov 2005
Posts: 134
Reputation:
Solved Threads: 10
Hi ,
Try this out, it worked well when I threw it together. But REMEMBER to read the note in the header... You have been warned...
Have fun
Yomet
Try this out, it worked well when I threw it together. But REMEMBER to read the note in the header... You have been warned...

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Public Sub CreateQuery() 'NOTE: this code NEEDS to have a reference to DAO ' If you already have a reference to ADO be sure ' to prefix your variable declarations correctly ' since there are some objects that are the same ' and you will never know which will be opened ' unless you prefix them, i.e. ' Dim ADORecs As ADODB.Recordset ' Dim DAOResc As DAO.Recordset ' Dim db As DAO.Database Dim MyQry As DAO.QueryDef Set db = DBEngine.OpenDatabase("<path to your database") Set MyQry = db.CreateQueryDef("<Query name>", "<SQL statement>") db.Close End Sub
Have fun
Yomet
![]() |
Similar Threads
- sql query problem with MS Access and C# (C#)
- Create Access Database using SQL queries (MS Access and FileMaker Pro)
- how to create new table in MS Access2003 database using VB6 (Visual Basic 4 / 5 / 6)
- Saving Query in Ms Access .MDb File using C++ (C++)
- Not able to save query in access (IT Professionals' Lounge)
- i want to save a query in MS Access Database throug c# coding (C#)
- Create an Access Database using Java (Java)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Add shortcut in DEsktop automatically
- Next Thread: pls help me
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





