Problem in INSERT [RESOLVED]
Hello everybody,
I am facing a problem in inserting record in Access database. Here is the short code snippet, which gives exception "Syntax error in INSERT INTO statement", however if I print the query by uncommenting the Response.Write line and copy the query and paste it in access and run, it runs well.
VB Code:
' Insert
Set Rs = Conn.Execute("SELECT [User].[UserName] FROM [User] WHERE [User].[UserName] = '" & UserName & "' AND [User].[IsDeleted] = False")
If Rs.EOF Then
Dim InsertSql
InsertSql = "INSERT INTO [User] (Name,UserName,Password,IsAdmin,IsSupervisor,IsDeleted) VALUES('" & FullName & "','" & UserName & "','" & Password & "'," & IsAdmin & "," & IsSupervisor & ",False)"
'Response.Write(InsertSql)
'Response.End
Cmd.ActiveConnection = Conn
Cmd.CommandText = InsertSql
Cmd.Execute()
'Set Rs = Conn.Execute(InsertSql)
Response.Redirect("User.asp?Message=UserAdded")
Else
Response.Redirect("User.asp?Message=UserFound")
End If
Re: Problem in INSERT [RESOLVED]
No, I understood you but was giving some insight to what I had to deal with at a particular college (what I mean :)) backing up the notion of
naming systems/servers with numbers is
not that great an idea. :D
Re: Problem in INSERT [RESOLVED]
Quote:
Originally Posted by RobDog888
No, I understood you but was giving some insight to what I had to deal with at a particular college (what I mean :)) backing up the notion of
naming systems/servers with numbers is
not that great an idea. :D
Oh - I get it now...
I'm from the days before networks where known - big old single CPU mainframe boxes - then clustered systems...
Then Ethernet and DECNET came into our world - we went nuts - starting naming things after stars, planets, disney characters, old star trek stuff...
Now - seems the hardware guy who installed my SBS and a Server 2003 system at one of my main customer sites decided on bland names like SERVER01, SERVER02, SERVER03 and SERVER04. When I RDP into that other system all kinds of reference problems pop up - he should have asked what we like to name them!
Re: Problem in INSERT [RESOLVED]
I just came accross a tweak that changes the My Computer desktop icon name to "Username loged on to machinename". Let me
see if I can find it again. ;)
Should help when logging into several desktops after another etc.
Re: Problem in INSERT [RESOLVED]
The registry tweak can be found here.