VB6 ADO Access 97 and Data Environments 
Author Message
 VB6 ADO Access 97 and Data Environments

I'm having some problems with an app I'm playing around with while
learning VB.

I thought that if I used a data environment I'd be able to share data
accross the forms better, and this works really well.  But how do you
add new records?

I have an Access table with VidID, VideoTitle, and DatePurchased in it
and I want to add another from a VB Form.  There is also a auto-inc
field as the first column in the table called ID.

In the data environment, I have a connection which is linked to my DSN
source VideoDB, which I set up in ODBC (32 bit) in the control panel.
Next I set up a command as an object under my connection.  I changed
it to a table type command with the table AllVideos.  But if I do an
dataenvironment1.rscommand1.addnew I get an error saying 'invalid or
unreferenced qualifier.'  Now, I'm not sure I'm doing this entirely
right...but I am going by example code in the docs.  here's what I
have...

Private Sub cmdAddNewVideo_Click()
  envVideoConnection.rsVideoTable.AddNew
    !VidID = txtVidID.Text
    !VideoTitle = txtVideoTitle.Text
    !DatePurchased = txtDatePurchased.Text
End Sub

Should I be putting something in for the auto-inc field?  What causes
this error to pop up?  Am I calling AddNew wrong?

Thanks for any help.

<ChipOne>



Mon, 21 May 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Moving data from Access 2 to Access 97 in VB6

2. VB6/ADO/Access 97 Unsuccessful Query

3. VB6/ADO/Access 97

4. VB6 ADO and Access 97 - Hierarchical Recordsets

5. ADO Query into Access 97 Database using VB6

6. Q: ADO, VB6 EE and MS Access 97

7. VB6/ADO/Access 97

8. Access 97 + ado + vb6

9. ADO Query into Access 97 Database using VB6

10. VB6 ADO and Access 97 - Hierarchical Recordsets

11. Slow connection Access 97 - VB6 - ADO on lan

12. ADO and DataGrid question (VB6 w/ Access ’97)

 

 
Powered by phpBB® Forum Software