mySQL caching with ADOX?
am 08.12.2004 20:42:40 von snoopy
Im trying to work out an issue extracting the table schema from a database
table.
The script could be run against mySQL (MySQLProv, 4.0.22-nt ) , SQL server
or Access
With SQL, access, I can use #1 or #2 quite happily, however cant quite say
the same for mySQL
Using #1 for mySQL, the definedsize for varchar columns is not returned
Using #2 provides me with all of the information I need, HOWEVER! it also
seems to be providing me with old records.
eg - if I DROP a column on page 1, then query the schema on page 2, the
column still remains (and remains for 20 + refreshes and then shows a true
record)
If I query the database with script #1 immediately, it does show the correct
database design.
If I display the design using phpMyAdmin, it also shows the correct design.
So I guess the question is, can I modify script #1 to show definedsize for
mySQL, or can I tweak either the script #2 or the database to return the
current record?
Or something totally different? :-)
Script #1
Set objRS = objConn.Execute(SQL)
For each fld in objRS.fields
tmpstring= tmpstring & fld.name &"," &fld.definedsize&"," & fld.type &","
Next
Script #2
set adoxConn = CreateObject("ADOX.Catalog")
adoxConn.activeConnection = objConn
set table = adoxConn.Tables(tablename)
for each column in table.columns
tmpstring= tmpstring& column.name &","& column.definedsize&","& column.type
&","
next
Re: mySQL caching with ADOX?
am 14.12.2004 21:24:46 von snoopy
Must be an issue with MySQLProv, myODBC works as expected.
"dave" wrote in message
news:%23waxi2V3EHA.1564@TK2MSFTNGP09.phx.gbl...
> Im trying to work out an issue extracting the table schema from a database
> table.
> The script could be run against mySQL (MySQLProv, 4.0.22-nt ) , SQL
server
> or Access
>
> With SQL, access, I can use #1 or #2 quite happily, however cant quite say
> the same for mySQL
>
> Using #1 for mySQL, the definedsize for varchar columns is not returned
> Using #2 provides me with all of the information I need, HOWEVER! it also
> seems to be providing me with old records.
> eg - if I DROP a column on page 1, then query the schema on page 2, the
> column still remains (and remains for 20 + refreshes and then shows a true
> record)
> If I query the database with script #1 immediately, it does show the
correct
> database design.
> If I display the design using phpMyAdmin, it also shows the correct
design.
>
> So I guess the question is, can I modify script #1 to show definedsize for
> mySQL, or can I tweak either the script #2 or the database to return the
> current record?
> Or something totally different? :-)
>
>
> Script #1
> Set objRS = objConn.Execute(SQL)
> For each fld in objRS.fields
> tmpstring= tmpstring & fld.name &"," &fld.definedsize&"," & fld.type &","
> Next
>
> Script #2
> set adoxConn = CreateObject("ADOX.Catalog")
> adoxConn.activeConnection = objConn
> set table = adoxConn.Tables(tablename)
> for each column in table.columns
> tmpstring= tmpstring& column.name &","& column.definedsize&","&
column.type
> &","
> next
>
>