Using ADOX to create and modify MySQL database

Using ADOX to create and modify MySQL database

am 28.11.2005 21:29:29 von Marja Ribbers

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 =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

Re: Using ADOX to create and modify MySQL database

am 29.11.2005 01:25:34 von Mark Schupp

I'm pretty sure that ADOX is specific to Access. Look up the appropriate DDL
commands for MYSQL and execute them as you would a SQL query or update.
Creating an index should be (although there can be some variation between
DBMSs):

CREATE INDEX ON

()

--
--Mark Schupp


"Marja Ribbers-de Vroed" wrote in message
news:uovkupF9FHA.1416@TK2MSFTNGP09.phx.gbl...
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