Pls exscuse me I am an absolute newbie. I hv setup an vb.net 2003 app that accesses and old access mbd but i need to have the db created during setup - has anyone got any advice or ideas
Your post is a bit confusing. First you say you're connecting to an existing older database, and then you say you need to create it.
If you need to create the database and tables therein, you need different code than connecting to an existing database.
To create a database, you need a function similar to this:
Public Function CreateDatabase(ByVal FileName As String) As Boolean
'Instantiate the ADOX Object
Dim ADOXCatalog As ADOX.Catalog = New ADOX.Catalog
Dim oConnect As String
'Setup the connection string
oConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & FileName
' Try creating the database
'Create the database
Catch ex As System.Runtime.InteropServices.COMException
Catch ex As Exception
'Show error message and return failure
MsgBox(ex.Message & vbCrLf & ex.StackTrace)
Return False Finally
'Dispose the object
ADOXCatalog = Nothing
If on the other hand you want to connect to an existing database, you would need something like this:
Dim cmd As New OleDb.OleDbCommand
Dim cmd1 As New OleDb.OleDbCommand
Dim con As New OleDb.OleDbConnection
If (Me.txtname.Text <> "" And Me.txtadd.Text <> "") Then
cmd.Connection = con
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=
Drive where database and path to example "C:\WindowsApplication1\DATABASENAME.mdb"
I am developing a simple job card creator application with VB.net 2012, using Access 2010 as database.
The code I have generated to write data from a datagridview to the database table is successfully saving the data, but with an error "Parameter @name has no default value". The ...
write a C++ program which take inputs from the user/keyboard and calculate his ZAKAT.
get the input from user may include
-Amount invested in business
-Amount given to other business partners as loan
-Amount payable to others
I made a prime number finder, it finds the nearest prime that is above and below any integer (Does not work that well with giant numbers.)
Made this in cpp.sh
Why would I need the x=y+1-1;?
x=y; just doesnt seem to work
Why is this?
And I know my coding ...