Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Fox Pro DataBase problem

SmokeXSmokeX Member Posts: 9
I'm having a problem adding records to my databse in VB. When I load the database into my program for the first time, I can add records just fine. I use Data1.Recordset.AddNew, and have textboxes with the datafield property set to various fields in the database. But after I close down my program, and then run it again, I can no longer add records to the database. Everytime I try it gives me an error that says: runtime error 3027 Cannot update. Database or object is read-only.

Why is this happening? Why does it work the first time, and then never again after that? Does VB lock the DB once it closses it for the first time? I'm using a foxpro 6.0 database and VB6 if that helps at all. I've edited Access databases in VB before, and this problem never arose. So maybe there's something different with a Fox Pro database. Can anyone help me?


  • gigsvoogigsvoo Member Posts: 328
    This could be cause by the first time u never issue a Update() to the AddNew(), and should close the connection properly by issuing Close() and set the object to nothing.

    Again, when u open the recordset, do not open exclusively...

    Neo Gigs

  • Chris BrownChris Brown USAMember Posts: 4,496 ✭✭

    ______ // // free ebooks and video tutorials about < Visual Basic, PL/SQL, PHP, Ruby, C++, Delphi, Java, Scratch, Perl, JavaScript, Assembly, Python, Go, C, Objective-C, Visual Basic .NET, R, Swift, C#, MATLAB SAS, Apex, Hack, Scala, COBOL, Awk, Fortran, Bash, FoxPro, LabVIEW, F#, Clojure, Logo, Dart, Lisp, Transact-SQL, VBScript, Erlang, Julia, Rust, Prolog, ABAP, Crystal, ML, Kotlin, Lua, Scheme, Ada, Alice, D /> _____________

Sign In or Register to comment.