Using ADOX to create and modify MySQL database
- From: "Marja Ribbers-de Vroed" <marja@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 28 Nov 2005 21:29:29 +0100
The following routine is part of a custom VBscript class in my webapplication:
Public Sub wsAddColumnIndex(p_sTable, p_sColumn, p_bUnique)
Dim l_oIndex
Set l_oIndex = Server.Createobject("ADOX.Index")
wsFeedback(" Creating index On Column: " & p_sColumn)
With l_oIndex
.Name = p_sColumn
.Columns.Append p_sColumn
If (p_bUnique = True) Then
.Unique = p_bUnique
End If
End With
s_oCatalog.Tables(p_sTable).Indexes.Append l_oIndex
Set l_oIndex = Nothing
End Sub
As you can see, this routine is used to dynamically add an index to a specified column for a specified table (s_oCatalog is an instance variable for my VBscript class and is set when instantiating my custom object).
This routine is working fine when using Access as the database, but when using this routine with MySQL I get an error on the line with '..Indexes.Append ':
"ADOX.Indexes error '800a0cb3'. Object or provider is not capable of performing requested operation."
Obviously the DB provider for MySQL does not understand 'Indexes.Append'
I'm using this connection string to connect to the MySQL DB:
"DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=mydb;USER=myname;PASSWORD=mypassword;OPTION=3;"
I've done some searching with Google trying to find more information on using ADOX for MySQL DB handling, but I haven't been able to come up with anything useful regarding the above index creation issue.
Can anyone point me in the right direction?
Thanks in advance.
--
Marja Ribbers-de Vroed
.
- Follow-Ups:
- Re: Using ADOX to create and modify MySQL database
- From: Mark Schupp
- Re: Using ADOX to create and modify MySQL database
- Prev by Date: Re: Suddenly ODBC driver does not work
- Next by Date: Re: Recordset.Open Causes Lockup/Timeout
- Previous by thread: Recordset.Open Causes Lockup/Timeout
- Next by thread: Re: Using ADOX to create and modify MySQL database
- Index(es):
Relevant Pages
|
Loading