|
|
Back to UserFriendly Strip Comments Index
| Visual Studio.net (VB6) |
by McGowan |
2005-02-14 06:25:51 |
Having a little trouble with the above annoying thing. I am working with an ms access db and I am trying to insert an entry into a simple database.
the links to the database all work correctly and SQL querys are working but I cant get the insert to work. Basically I have a button i click on and it is supposed to work. Heres the code.
personsDataAdapter.InsertCommand.CommandText = "INSERT INTO persons (ID, Name, Sex, Ability) " & _
"VALUES ('5', 'Ben', 'Male', 'Beginner')"
personsDataAdapter.InsertCommand.ExecuteNonQuery()
It comes back with an error saying "ExecuteNonQuery requires an open and available connection, the connection is currently closed"
But like I say everything else would suggest it is open. Any help greatly appreciated. |
|
[ Reply ] |
|
Try this | by NCBob27409 | 2005-02-14 07:34:11 |
|
And put the ExecuteNonQuery inside a "try", with | by bwkaz | 2005-02-14 14:49:51 |
|
|
[Todays Cartoon Discussion]
[News Index]
|
|