The following code is an example of creating a Table and Columns using ActiveX Data Objects (ADO):
Sub CreateEmployee() Dim cn As ADODB.Connection
End Sub
Dim strSQL As String
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=c:\test.mdb;"
cn.Open
strSQL = "CREATE TABLE `Employee` (`Last Name` varchar(30), `First Name` varchar(30), `Age` integer)"
cn.Execute strSQL
cn.Close
Click here to subscribe and receive Pro-business Excel VBA Programming tips. |
0 comments:
Post a Comment