Using ADOX to create and modify MySQL database
am 28.11.2005 21:29:29 von Marja RibbersThe 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 =3D Server.Createobject("ADOX.Index")
wsFeedback(" Creating index On Column: " & p_sColumn)
With l_oIndex
.Name =3D p_sColumn
.Columns.Append p_sColumn
If (p_bUnique =3D True) Then
.Unique =3D p_bUnique
End If
End With
s_oCatalog.Tables(p_sTable).Indexes.Append l_oIndex
Set l_oIndex =3D 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 ':=20
"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=3D{MySQL ODBC 3.51 =
Driver};SERVER=3Dlocalhost;DATABASE=3Dmydb;USER=3Dmyname;PAS SWORD=3Dmypas=
sword;OPTION=3D3;"
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?=20
Thanks in advance.
--=20
Marja Ribbers-de Vroed