View Single Post
  #2 (permalink)  
Old 03-31-2009, 8:49 AM
cathalo cathalo is offline
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Mar 2009
Posts: 4
Reputation: 0
cathalo is on a distinguished programming path ahead
Default

Good to see the message has been read, no replies.

I've progressed a little - I have found some code (however I don't completely understand it) that creates an Access DB.

Code:
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
I have also found a few sample "CopyTable" examples - but receive various errors from these.

I will keep digging.
Reply With Quote