techie_vb
January 24th, 2006, 03:44 AM
Hi,
I don't know whether I should post this query in Vb forum or Database forum.
Kindly reply for my query and am sorry to Cross post the query.
Iam using Vb Express Edition 2005.
I have tried connecting SQL Express 2005 with VB 2005.
Iam getting an exception like the following when I run the project.
***
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
***
I have tried to Connect to the Database through Buton Click Event.
I have created a Database (FirstDB.mdf) which have 5 records.
I have included "Microsoft ADO Data Objects (Multi Dimensional) 2.8 Library"in the New_Sql project.
I have chosen "SQL Authentication" here rather than "Windows Authentication".
My Code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("Trying to Connect SQLServer 2005")
Dim con As New ADODB.Connection
Dim res As New ADODB.Recordset
con.Open("Data Source=.\SQLEXPRESS;AttachDbFilename=FirstDB.mdf;Integrated Security=True;User Instance=True;UserName=newproject;password=tech")
MsgBox("Connected SQL Server 2005")
End Sub
End Class
Can anyone help me to fix the exception in this program?
Thanks in Advance!!!
I don't know whether I should post this query in Vb forum or Database forum.
Kindly reply for my query and am sorry to Cross post the query.
Iam using Vb Express Edition 2005.
I have tried connecting SQL Express 2005 with VB 2005.
Iam getting an exception like the following when I run the project.
***
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
***
I have tried to Connect to the Database through Buton Click Event.
I have created a Database (FirstDB.mdf) which have 5 records.
I have included "Microsoft ADO Data Objects (Multi Dimensional) 2.8 Library"in the New_Sql project.
I have chosen "SQL Authentication" here rather than "Windows Authentication".
My Code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("Trying to Connect SQLServer 2005")
Dim con As New ADODB.Connection
Dim res As New ADODB.Recordset
con.Open("Data Source=.\SQLEXPRESS;AttachDbFilename=FirstDB.mdf;Integrated Security=True;User Instance=True;UserName=newproject;password=tech")
MsgBox("Connected SQL Server 2005")
End Sub
End Class
Can anyone help me to fix the exception in this program?
Thanks in Advance!!!