Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB recordset with Sybase SQL Anywhere

Posted on 2002-05-16
4
Medium Priority
?
359 Views
Last Modified: 2006-11-17
Hi,
Suppose I have 2 tables:

 tblCustomers             tblContacts
PK noCust                PK noContact
   nameCust                 nameContact
                         FK noCust

noCust and noContact have a default value of autoincrement.

My problem is that, with MS Access 97, I can't had a customer and a contact at the same time:

        rstCust.AddNew
        rstCust!nameCust = Me.nameCust
        rstCust.Update
       
        rstCust.Bookmark rstCust.LastModified            

        rstContacts.AddNew
        rstContacts!nameContact = Me.nameContact
ERROR-> rstContacts!noCust = rstCust.noCust
        rstContacts.Update

I have a message that says that my record has been deleted. Is there a way (there should be) to make this work? All I want to do is to add those records in the same "transaction".

Any help would be appreciated, thanks
Jeff
0
Comment
Question by:jeanfrancoismelancon
4 Comments
 

Author Comment

by:jeanfrancoismelancon
ID: 7013774
And my problem is with the autoincrement clause... I can't get back the value of noCust... the bookmark/lastmodified dosen't seem to work.
0
 

Accepted Solution

by:
EggSpurt earned 400 total points
ID: 7392259
Jeff,

I don't have a very satisfactory answer (maybe you do by now in which case please share it) but I've had a similar problem trying to use addnew. In my case I entered values for several fields at once, all the fixed length data types updated successfully but long varchar/text fields remain blank. Though this doesn't cause an error on the .update command it throws up errors if you subsequently try to read or work with the values that failed to add.
One workaround which may work here is to update and close the recordset then immediately reopen a recordset on this record (in your case where nameCust = Me.nameCust).
I think you would then be able to read rstCust!noCust
In my case I was then able to edit the record and enter the values for all the long varchars etc.
I'm still searching for a proper explanation and solution which is how I came across your question.

Cheers,
John
0
 
LVL 6

Expert Comment

by:ChrisKing
ID: 9949345
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: EggSpurt

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

ChrisKing
EE Cleanup Volunteer
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have come across a situation where you need to find some EDB mailbox recovery techniques, then here you will find the same. In this article, we will take you through three techniques using which you will be able to perform EDB recovery. You …
There can be many situations demanding the conversion of Outlook OST files to PST format and as such, there is no shortage of automated tools to perform this conversion. However, what makes Stellar OST to PST converter stand above the rest? Let us e…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month12 days, 22 hours left to enroll

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question