I would like to create a database and add tables from VBA. Can someone help me ? I have tried the following code with no sucess :(
Dim conn, rst
Set conn = CreateObject("ADODB.Connection")
conn.ConnectionString = "Provider=MSDASQL;DSN=WINCC;UID=;PWD;"
conn.CursorLocation = 3
str = "CREATE DATABASE MyDatabase1"
Set rst = conn.Execute(str)
What error message are you getting when you run that?