Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

0bject reference error

Status
Not open for further replies.

compdrmt

Programmer
Sep 22, 2002
60
0
0
US
here is the code that causes the error

I have tried the same thing various ways and always get the same error

object reference nt set to instance of object

Private conn As New OleDbConnection(sconnstring)

Dim adapter As New OleDbDataAdapter
Dim cmd As OleDbCommand

ssql = "INSERT INTO assets (desc, col2value,col3value) "
ssql = ssql & "VALUES ('" & desclist.Text & "','" & desc2.Text
ssql = ssql & "','" & desc.Text & "')"

cmd.Connection = conn
cmd.CommandType = CommandType.Text
cmd.CommandText = ssql
cmd.ExecuteNonQuery()



Any ideas


Compdrmt

Debugging is the process of removing bugs. Programming is the process of putting them in.
 
perhaps this

Dim cmd As new OleDbCommand


Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top