Jump to content
Xtreme .Net Talk

CybrDemon

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by CybrDemon

  1. muahahaha....someone enlightened me... somehow "password" is a reserved word...so you can't use it as a column name. Same with "date" i think. :D
  2. Hi guys, I've been working with databases under the old ASP and Java (I'm familiar with SQL), and I've just started to play with VB .net not long ago. I'm getting syntax errors where i shouldn't get any! This is the code: Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=FFFF_users.mdb;" conn = New OleDbConnection(connString) conn.Open() command = New OleDbCommand("INSERT INTO users VALUES ('" & realName & "', '" & username & "', '" & password & "')", conn) success = command.ExecuteNonQuery() = 1 The above works for an insertion, but if i change the INSERT statement to: "INSERT INTO users (realName, username, password) VALUES ('" & realName & "', '" & username & "', '" & password & "')" which specifies the columns explicitly, then i get a nice little exception: I've tried just typing that INSERT command into an Access query, and it works. So i'm wondering if this is some issue with OleDb? I get a syntax error with UPDATE as well: command = New OleDbCommand("UPDATE users SET password = '" & newPassword & "' WHERE username = '" & username & "'", conn) this is truly weird :confused: [edit]Please use tags [/ vb]...It is impossible to see Silver on a Grey background [/edit]
×
×
  • Create New...