If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > MySQL reads but won't write!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-11-04, 21:02
RT-UK RT-UK is offline
Registered User
 
Join Date: Oct 2004
Posts: 2
MySQL reads but won't write!

Hi All,
Can I apologise in advance if this is off topic. I am coding a database program using VB6(ADO) and MySQL as the db server. The two are talking through an ODBC driver.

I can use the Mysql windows control centre to add data to the database, which I can then read through the VB programme with no problems. However, when I come to write data to the database table from within the programme, VB executes the code fine - no errors produced at all and everything seems ok, until you interrogate the database and its added nothing. Not even a blank record.

I suspect as VB isn't returning an error, it must be something to do with the way I'm establishing the connection with ODBC.

Can anybody answer the problem or point me in the right direction??? I've been pulling my hair out with this for three days and there isn't much left now!!

Cheers
Richard (UK).
Reply With Quote
  #2 (permalink)  
Old 10-12-04, 07:41
Daniel_Johns Daniel_Johns is offline
Registered User
 
Join Date: Jul 2004
Posts: 69
hi Richard. Maybe if you supply a code snippet will give us at least an bird's eye view of the problem.
Reply With Quote
  #3 (permalink)  
Old 10-12-04, 10:20
RBARAER RBARAER is offline
Registered User
 
Join Date: Aug 2004
Location: France
Posts: 754
Hello,

Given what you said, it seems like you insert data, but not "commit" it, which means that once your VB program ends up, all inserted data is "rolled back". Between two commits, all the modifications you do on the data in the database (inserts, deletes, updates) are specific to your session, not "validated", and nobody else can see these changes. Once committed, the changes are really done. But if you leave your session without having committed, then you will have lost all the changes you had made. I think that's just what is happening to you right now. Check that you have something like auto-commit on, or even better (because auto-commit slows down the process as a commit will be done after each insert) issue a commit once you've finished, or every second... it depends on your needs. Sorry but I don't know the VB command for issuing a commit.

Regards,

RBARAER
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On