VB.net Create .accde file on a machine that doesn't have Access
Hi
I am using the following VB.net code in my Excel Add-in to create an Access
database. Certain of the users of my app will not have Access on their machines.
Will this sort of code be able to create a .accde file?
Public Sub Create_Access()
Dim P As String = "C:\Users\murbro\Documents\TestDB.accdb"
If CreateAccessDatabase(P) = True Then
MsgBox("Database Created")
Else
MsgBox("Database Creation Failed")
End If
End Sub
Public Function CreateAccessDatabase( _
ByVal DatabaseFullPath As String) As Boolean
Dim bAns As Boolean
Dim cat As New ADOX.Catalog()
Try
'Make sure the folder
'provided in the path exists. If file name w/o path
'is specified, the database will be created in your
'application folder.
Dim sCreateString As String
sCreateString = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
DatabaseFullPath
cat.Create(sCreateString)
bAns = True
Catch Excep As System.Runtime.InteropServices.COMException
bAns = False
'do whatever else you need to do here, log,
'msgbox etc.
Finally
cat = Nothing
End Try
Return bAns
End Function
An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.
One of a set of tools we're offering as a way of saying thank you for being a part of the community.
For our application this was ADODB.dll
I think that it will save the file as *.mdb format rather than the newer *.accdb