View Full Version : Connecting to a Database.
03-27-2013, 04:28 PM
I am struggling connecting to an Access Database.
Basically I am using Visual Studio 2010 and want
to connect to an Access 2010 Database.
All I want to do is add the details to the Database such as;
Forename, Surname, Address, etc
Once a button is clicked.
Any help would be much appreciated.
03-27-2013, 08:22 PM
04-03-2013, 08:12 PM
Dim conn As New System.Data.OleDb.OleDbConnection()
Dim cmd As New System.Data.OleDb.OleDbCommand()
conn.ConnectionString = " Provider=Microsoft.ACE.OLEDB.12.0;Data Source= C:\Users\Jonathan\Desktop\BeechSports.accdb;Persist Security Info=False;"
cmd.CommandText = "INSERT INTO Register (First_Name)" & _
" Values (" & Me.txtFirstName.Text & "')"
Catch ex As Exception
' MessageBox.Show("Failed to connect to data source: " & vbLf & ex.Message)
I have now altered my code but, with no joy.
Can anybody help please?
04-04-2013, 03:13 PM
Check out the link that I have provided below as it will guide you to establish a database connection.
04-06-2013, 11:13 AM
Take a look on this article for how to connect to MS Access and other database
05-03-2013, 02:52 PM
Why do want to use access database while you are using Visual Studio 2010 ? Try SQL Server Express Edition, which is inbuilt in Visual Studio.
05-08-2013, 03:13 PM
Have you tried to use Sql Server Express Edition which comes along with Visual Studio 2010 ?
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.