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!!
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.