J
Jayyde
The following code is throwing the ever-informative "ODBC--call failed"
error on the cmd.Execute line of the following code:
Dim cmd As ADODB.Command
Dim cnn As ADODB.Connection
Dim strSQL As String
Dim index As Integer
index = DLookup("[NextPKofCategoryHierarchy]", "qryCategoryHierarchy")
strSQL = "INSERT INTO dbo_tblProductCategoryHierarchy " _
& "(iProductCategoryHierarchyId, " _
& "iProductCategoryId, " _
& "iProductCategoryParentId) " _
& "VALUES(" _
& index & ", " _
& id & ", " _
& intParentID & ");"
Set cnn = Application.CurrentProject.Connection
Set cmd = New ADODB.Command
Set cmd.ActiveConnection = cnn
cmd.CommandText = strSQL
cmd.Execute
Not sure why, I've stared at the SQL til my right eye went blind (honest)
and it's fine. I also have similar code in a few of my other forms all
working fine. If any of you gurus can shed some light on this it'd be
awesome! Thanks ahead of time!
-Jayyde
error on the cmd.Execute line of the following code:
Dim cmd As ADODB.Command
Dim cnn As ADODB.Connection
Dim strSQL As String
Dim index As Integer
index = DLookup("[NextPKofCategoryHierarchy]", "qryCategoryHierarchy")
strSQL = "INSERT INTO dbo_tblProductCategoryHierarchy " _
& "(iProductCategoryHierarchyId, " _
& "iProductCategoryId, " _
& "iProductCategoryParentId) " _
& "VALUES(" _
& index & ", " _
& id & ", " _
& intParentID & ");"
Set cnn = Application.CurrentProject.Connection
Set cmd = New ADODB.Command
Set cmd.ActiveConnection = cnn
cmd.CommandText = strSQL
cmd.Execute
Not sure why, I've stared at the SQL til my right eye went blind (honest)
and it's fine. I also have similar code in a few of my other forms all
working fine. If any of you gurus can shed some light on this it'd be
awesome! Thanks ahead of time!
-Jayyde