Here is my question: I have created an MS Access database and I am trying to create a connection using VB2005
Thanks
J
Here is my question: I have created an MS Access database and I am trying to create a connection using VB2005
Thanks
J
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vijaya KadiyalaPosted Feb 9, 2009, 12:37 PM
Hi Check out the below link
http://www.astahost.com/info.php/vb-net-ms-access-interaction-tutorial-part_t12054.html
Thanks
-- Vijaya Kadiyalahttp
://dotnetvj.blogspot.comSriram RamaniPosted Jan 31, 2009, 9:13 AM
All u need is first select add new database and select the MS.Access database and load ur file and table..
then u must add a connection
first include the "import system.data.oledb" namespace....
then include this code:
Dim
a As String Public cn As OleDbConnection Public cmd As OleDbCommand Public dr As OleDbDataReader Public Sub conn()a =
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Bday pro database\bday.accdb" ---"bday" name of ur filecn =
New OleDbConnection(a)cn.Open()
End Subtheo philusPosted Jan 20, 2009, 4:33 PM
OleDbConnection conn=new OleDbConnection(@"Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:\students.mdb");
conn.Open();
OleDbCommand cmd=new OleDbCommand();
conn.Connection=conn;
conn.CommandText=String.Format("Select * from Students");
OleDbDataAdapter adp=new OleDbDataAdapter(cmd);
int temp=cmd.ExecuteNonQuery();
if(temp>0)
{
MessageBox.Show("Records Selected");
}
else
{
MessageBox.Show("Records Not Selected");
}
From SIAMEH THEOPHILUS UNIVERSITY OF GHANA,LEGON-----00233 243559227