Question for anyone who has used parameter queries with querydef objects in VB 
Author Message
 Question for anyone who has used parameter queries with querydef objects in VB

Hello,
        I'm trying to use a parameter of type TABLEID so I can pass table
names to the querydef object at run time.  This is what I have:
 Dim q As querydef
 Dim ssql As String
 Dim db As database

Set db = OpenDatabase("g:\projects\mple\input\mpf.mdb")

ssql = "parameters myvalue text, thetable tableid; INSERT INTO it_itms IN
'g:\projects\mple\input\template.mdb' SELECT it_itms.* FROM thetable where
it_itms.it_itm_id = myvalue;"

 Set q = db.OpenQueryDef("copy")
 q.SQL = ssql
 q!myvalue = "ab"
 q!thetable = "it_itms"
 q.Execute

This results in a GPF in vb.exe under Win95.  GPF occurs only when I use
tableid.  Anyone know what I'm dong wrong?
                Thanks in advance,
                                -=Matthew=-




Thu, 11 Dec 1997 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Question for anyone who has used parameter queries in querydef objects under VB

2. Newbiw having problems with Permanent QueryDef: Query input must contain at least one table or query

3. Parameter Queries Error using QueryDef

4. Passing Parameters to stored parameter queries using VB 5's Data Controls

5. To Few Parameter, Expecting XX in Querydef object

6. Update query with querydef object

7. Silly question -- Parameter Query using DBGrid.

8. Help! Cannot specify parameters using QueryDef in ODBCDirect

9. Using Parameters in QueryDef bound to Data Control

10. Silly question -- Parameter Query using DBGrid.

11. Silly question -- Parameter Query using DBGrid.

12. Data control using an Access QueryDef *with* parameters.

 

 
Powered by phpBB® Forum Software