New topic: Inserting new record into ms access db. need help
<http://forums.realsoftware.com/viewtopic.php?t=45518> Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message Antonio Post subject: Inserting new record into ms access db. need helpPosted: Thu Oct 04, 2012 4:30 am Joined: Sat Feb 04, 2012 1:26 pm Posts: 13 Hi, im am experiencing some problems in writing into a mdb file. I wish to insert a new record into the databae, but i did not succeed. I wrote the following code into the pushbutton's action event, but seems not to work correctly: may you help me to discover what's wrong. Dim db as ODBCDatabase db=New ODBCDatabase db.datasource ="DRIVER=Microsoft Access Driver (*.mdb); UID=admin; UserCommitSync=Yes; Threads=3;SafeTransactions=0;PageTimeout=5;MaxScanRows=8;MaxBufferSize=512;ImplicitCommitSync=Yes;FIL=MS Access;DriverId=25;DefaultDir=C:\;DBQ=C:\db.MDB" dim rec as DatabaseRecord rec = New DatabaseRecord If db.Connect() then rec.Column("name")= textfield1.text rec.Column("counttry")= textfield2.text db.InsertRecord("table1",rec) db.Commit else Beep MsgBox "The database couldn't be opened." end if thanks for helping Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 1 post ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
