I am using VB.NET 2005 to access a MySQL 5 database.
I expected the following code snippet to give me a parameter count of 3 but it gives me 0.
Note:
- The connection to DB is established (tested)
Any ideas?
Please help!
'Create a connection to DB
Dim cn as New ADODB.Connection
cn.Mode = ADODB.ConnectModeEnum.adModeReadWrite
cn.CursorLocation = ADODB.CursorLocationEnum.adUseClient
cn.Open("MyDSN_Name_ODBC")
'Run Parameter Query
Dim cmd As New ADODB.Command
cmd.ActiveConnection = cn
cmd.CommandText = "INSERT INTO `tblgroups` ( " & _
" `groupID` , `GroupName` , `Description` " & _
" ) VALUES ( " & _
" ? , ? , ? " & _
")"
'Debug
Msgbox(cmd.Parameters.count) ' It gives me 0, WHY????
...