Re: i have a question about rename table through ADOX with C++



i have find some code on web :
Dim cn As ADODB.Connection
Dim t As Table

Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;data Source=C:\biblio.mdb"
Dim cat As ADOX.Catalog
Set cat = New ADOX.Catalog
Set cat.ActiveConnection = cn
cat.Tables("Authors").Name = "Authors2"

'Iterate through the tables collection
For Each t In cat.Tables
If t.Name = "Authors2" Then
Debug.Print t.DateModified
End If
Next

cn.Close
Set cn = Nothing

1. That code is Visual BASIC code not C++
2. This newsgroup is for ADO not ADO.NET.
For ADO.NET post to microsoft.public.dotnet.framework.adonet

There are some problem when i write in VC++ .net
Set cn = New ADODB.Connection < ---- i cannot new it using cn = new
ADODB::Connection
cat.Tables("Authors").Name = "Authors2" < -------- Tables doesnt take
any argument

3. That is not C++. C++ does not have Set. And Array subscripts are [] not
().

Stephen Howe



.



Relevant Pages