DataGrid (VB6) in Acces2003 form

  • Thread starter Thread starter Jurek
  • Start date Start date
J

Jurek

Hi all,

DataGrid from VB6 in in main form.
I build recordset :

Dim qdf_temp As QueryDef
Set qdf_temp = CurrentDb.CreateQueryDef("", tmpSQLstr)

Dim rs As Recordset
Set rs = qdf_temp.OpenRecordset

If I try

DataGrid.DataSource=rs

I receive message "Type mismatch"

Why ? Where is mistake ?
What is difference when I build recordset which based on DAO or ADO? Is
different internal structure or something another ?

Regards
Jurek
 
Not sure, but since you're dealing with objects, not variables, you probably
need to use

Set DataGrid.DataSource=rs
 
Hello,

Thank's for answer.

Of course , should be as you wrote. I missed "set" in post :-(

I try use DAO, but I'm not sure that it is possible, is it ?

Regards
Jurek
 
I would expect DAO should work: I believe VB6 predates the introduction of
ADO, so its controls would be execting DAO recordsets.
 
I was wondering how you get a datagrid in Access. How is that done? Can it
be done in Access 2002?

Robert
 
Try setting the DefaultView property of the form to Datasheet and see
whether that's what you need.
 
Somehow I had gotten the impression you could only do that with subforms.
If you double click on a line is there some way to get key value for that
line for a drill down?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top