HI everyone.
I am new in programming. I am creating a program that runs off of mdb database. I have the database working now but I have run into a bug.... If the database doesn't exist I need to be able to create one. Here is the code I need help with. I have no idea how to create a database from code. I need help with the code to create the tables as well. I have looked everywhere and nothing works or makes sense. Thanks for the help
Dim MyFile As New IO.FileInfo("c:\Program Files\code\data.mdf")
Dim MyFile2 As New IO.FileInfo("c:\Program Files\code\Code.mdf")
If MyFile.Exists() Then
Else
'Create Database and table here("c:\Program Files\code\data.mdf")
End If
If MyFile2.Exists() Then
Else
'Create Database and table here("c:\Program Files\code\Code.mdf")
End If
I am new in programming. I am creating a program that runs off of mdb database. I have the database working now but I have run into a bug.... If the database doesn't exist I need to be able to create one. Here is the code I need help with. I have no idea how to create a database from code. I need help with the code to create the tables as well. I have looked everywhere and nothing works or makes sense. Thanks for the help
Dim MyFile As New IO.FileInfo("c:\Program Files\code\data.mdf")
Dim MyFile2 As New IO.FileInfo("c:\Program Files\code\Code.mdf")
If MyFile.Exists() Then
Else
'Create Database and table here("c:\Program Files\code\data.mdf")
End If
If MyFile2.Exists() Then
Else
'Create Database and table here("c:\Program Files\code\Code.mdf")
End If