VB 6.0 - How to create query in access using vb6 0

Asked By CHANDU V on 04-Jul-06 03:12 AM
Hi,

1.how to create query in access using vb6.0 through ADO's. 
    without open mdb file how to create query

2. how to display access report through vb 6.0.

anybody help me.

regards
thanks in advance

re - Asked By Rupali Randhave Kolhe on 04-Jul-06 05:06 AM

Create query in access:

Here is how to create a temporary QueryDef: 
====================================== 
Dim db as Database 


Sub QDExample() 


Dim qd as QueryDef 
Dim pramA as Parameter 
Dim pramB as Parameter 
Dim SQL as String 


SQL = SQL & "PARAMETERS YourVarA STRING, " 
SQL = SQL & "YourVarB INTEGER; " 
SQL = SQL & "SELECT fieldA, 
SQL = SQL & "[YourVarA] as fieldB " 
SQL = SQL & "INTO temptable " 
SQL = SQL & "FROM [your table] " 
SQL = SQL & "WHERE thisfield = [YourVarB] " 


Set qd = db.CreateQueryDef("",SQL) 
Set pramA = qd!YourVarA 
Set pramB = qd!YourVarB 


pramA = "A string" 
pramB = 555 


qd.execute 


qd.close 


End Sub 
========================================= 


If you have a Access Database with an existing QueryDef then do this 


Set qd = db.QueryDefs("<the name of the querydef>") 
qd.execute 


<<<To delete this QueryDef>>> 
db.QueryDefs.Delete qd.Name 


Hope this helps,

Open/Print report - Asked By Rupali Randhave Kolhe on 04-Jul-06 05:08 AM

http://groups.google.co.in/group/microsoft.public.vb.enterprise/browse_thread/thread/f54409b66ac1b8e5/35616268e6edc72e?lnk=st&q=how+to+open+ms+access+report+from+vb+6.0&rnum=4&hl=en#35616268e6edc72e

error occured - Asked By CHANDU V on 04-Jul-06 07:14 AM

Hi, 

I do this type process, there is an error occured ie. unrecognised database format. 

so, there is any possibility using ADO's to create query in access database. 


regards,
Oracle - Asked By mohd jahed on 05-Jul-06 03:51 AM
How many type of databases are there? briefly describe each one's functions.
What is Groupby clause? Whether we can restrict columns with the help of groupby clause.