Hi, I am trying to delete a database using the SQL query string "DROP DATABASE Copy of Account_Details". I have looked for some help but have been unable to find some.
Dim strConnString As New Connection
Dim strDir As New Directory
Dim strConn As String
Dim strCommand As String
strCommand = "DROP DATABASE Copy of Account_Details.mdb"
strConn = strConnString.ConString("copy of account_details.mdb", strDir.RootDir)
Dim myConnection As New OleDbConnection(strConn)
Dim myCommand As New OleDbCommand(strCommand, myConnection)
myConnection.Open()
myCommand.ExecuteNonQuery()
myConnection.Close()
When I get to the executenonquery command, I get an unhandled error in the dll.
What am I doing wrong and how do I successfully delete/ remove this database?
I am also trying to add new databases (sql = "CREATE DATABASE Test") using code but when the myconnection.open code is excecuted, I get an error saying the conenction is not open.
How do I create a database on the fly using sql code?
Thank you in advance for your answeres.
Dim strConnString As New Connection
Dim strDir As New Directory
Dim strConn As String
Dim strCommand As String
strCommand = "DROP DATABASE Copy of Account_Details.mdb"
strConn = strConnString.ConString("copy of account_details.mdb", strDir.RootDir)
Dim myConnection As New OleDbConnection(strConn)
Dim myCommand As New OleDbCommand(strCommand, myConnection)
myConnection.Open()
myCommand.ExecuteNonQuery()
myConnection.Close()
When I get to the executenonquery command, I get an unhandled error in the dll.
What am I doing wrong and how do I successfully delete/ remove this database?
I am also trying to add new databases (sql = "CREATE DATABASE Test") using code but when the myconnection.open code is excecuted, I get an error saying the conenction is not open.
How do I create a database on the fly using sql code?
Thank you in advance for your answeres.