Using ADOX to create and modify MySQL database



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

.



Relevant Pages

  • Re: Using ADOX to create and modify MySQL database
    ... I'm pretty sure that ADOX is specific to Access. ... commands for MYSQL and execute them as you would a SQL query or update. ... The following routine is part of a custom VBscript class in my ... Obviously the DB provider for MySQL does not understand 'Indexes.Append' ...
    (microsoft.public.inetserver.asp.db)
  • Re: [PHP] Reoccurring task manager
    ... [MySQL] ... [PHP] ... Your routine for HTML-izing the output from the database.... ...
    (php.general)
  • Re: Advanced copying of range from one workbook to another
    ... Public Sub Select_Sheet ... On Jan 17, 4:28 am, Craig Handley ... then Jan 08 will have 'forecast' figures in it. ... The copy/paste routine will ...
    (microsoft.public.excel.programming)
  • Re: Remove all excess vbcrlf from end of document
    ... For the whole routine to work without an error, you need to add the line ... Public Sub Delete_Empty_Lines ... Dim objRange As Range ... .Execute Replace:=wdReplaceAll ...
    (microsoft.public.word.vba.beginners)
  • Re: help required for: Copy / Paste command
    ... Public Sub ProgErrorHandler(ByVal FuncOrSubName As String, ... The EndApplication routine is just used to close down any global variables ... > Catch ex As Exception ...
    (microsoft.public.dotnet.languages.vb)

Loading