I want to run a DDL query to add a field to a table in a SQL server database from VBA using a DSN but I can’t figure out how to run it. This is what I have so far –
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
cn.Open “dsn=MyData”
strSQL = “ALTER TABLE Customer ADD UploadTime SMALLDATETIME”
so how do I execute this statement against the connection?