D
darrel
I'm still struggling to find out why I keep getting
Invalid object name 'monkey'.
errors. Below is my try/catch statement. Note the first query is trying to
delete a record in the table MONKEY. If I omit this, it performs the second
query just fine, but it always hang on this first one.
I've copied this MONKEY table into a new, differently named table, but still
get the same error. I can run this query within Enterprise manager, and it
executes just fine.
The issue with the error seems to be that it can't find the table, but it is
clearly there, so I am completely stumped as to what to check next in
determining the source of my error.
-----------------------
Try
Dim strConnect As String
strConnect =
System.Configuration.ConfigurationSettings.AppSettings("DBConnProduction")
Dim strChk1 As String = "DELETE FROM monkey WHERE UserID='" &
Request.QueryString("UserID") & "'"
Dim strChk2 As String = "DELETE FROM we_admin_linkUsersToCategories WHERE
UserID='" & Request.QueryString("UserID") & "'"
Dim objConnect As New System.Data.OleDb.OleDbConnection(strConnect)
objConnect.Open()
Dim objCommand1 As New System.Data.OleDb.OleDbCommand(strChk1,
objConnect)
objCommand1.ExecuteNonQuery()
Dim objCommand2 As New System.Data.OleDb.OleDbCommand(strChk2,
objConnect)
objCommand2.ExecuteNonQuery()
objConnect.Close()
objCommand1.Dispose()
objCommand2.Dispose()
objCommand1 = Nothing
objCommand2 = Nothing
objConnect = Nothing
catch
'error stuff
end try
-Darrel
Invalid object name 'monkey'.
errors. Below is my try/catch statement. Note the first query is trying to
delete a record in the table MONKEY. If I omit this, it performs the second
query just fine, but it always hang on this first one.
I've copied this MONKEY table into a new, differently named table, but still
get the same error. I can run this query within Enterprise manager, and it
executes just fine.
The issue with the error seems to be that it can't find the table, but it is
clearly there, so I am completely stumped as to what to check next in
determining the source of my error.
-----------------------
Try
Dim strConnect As String
strConnect =
System.Configuration.ConfigurationSettings.AppSettings("DBConnProduction")
Dim strChk1 As String = "DELETE FROM monkey WHERE UserID='" &
Request.QueryString("UserID") & "'"
Dim strChk2 As String = "DELETE FROM we_admin_linkUsersToCategories WHERE
UserID='" & Request.QueryString("UserID") & "'"
Dim objConnect As New System.Data.OleDb.OleDbConnection(strConnect)
objConnect.Open()
Dim objCommand1 As New System.Data.OleDb.OleDbCommand(strChk1,
objConnect)
objCommand1.ExecuteNonQuery()
Dim objCommand2 As New System.Data.OleDb.OleDbCommand(strChk2,
objConnect)
objCommand2.ExecuteNonQuery()
objConnect.Close()
objCommand1.Dispose()
objCommand2.Dispose()
objCommand1 = Nothing
objCommand2 = Nothing
objConnect = Nothing
catch
'error stuff
end try
-Darrel