Hello,
I’m trying to use a MySQL prepared statement with a variable number of fields. I get a csv file of data, top row is field names, the number of columns varies. I create the table and then need to import the data. I’m getting an error when trying to do the BindType using a string variable for that line. I’m using the example from the docs and trying to get that working.
http://developer.xojo.com/mysqlpreparedstatement
The error I get is: There is more than one item with this name and it’s not clear to which it refers.
As in the docs I want to reuse the prepared statement to insert new rows of data.
[code] // EXAMPLE FROM THE DOCS
'ps.BindType(0, MySQLPreparedStatement.MYSQL_TYPE_STRING)
'ps.BindType(1, MySQLPreparedStatement.MYSQL_TYPE_LONG)
// TEST USING VARIABLE
Dim vBind1 As String = "0, MySQLPreparedStatement.MYSQL_TYPE_STRING"
Dim vBind2 As String = "1, MySQLPreparedStatement.MYSQL_TYPE_LONG"
ps.BindType(vBind1)
ps.BindType(vBind2)[/code]
If I reduce this to just one BindType I still get the error. It has something to do with trying to use a variable string it seems.
Can’t figure this one out.