By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,097 Members | 1,431 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,097 IT Pros & Developers. It's quick & easy.

HELP needed with Visual studio 2005

P: 1
I used Visual Studio 6 and I had made a simple program to access a SQL 2000 database, now I'm trying to do the same thing with Visual studio 20005, but.....nothing works.

I used to connect with ADODC to by database and on the Form was a TextBox
, a Button and a DataGrid. The user was writting in the TextBox and when he pressed th Button in the DataGrid was able to see the results

The code I was using was this:
Private Sub Command1_Click()


Dim username As String
Dim Password As String


username = Form1.Text1.Text
Password = Form1.Text2.Text


With Adodc1
.ConnectionString = "driver={SQL Server};" & _
"server=local;uid=" & username & ";pwd=" & Password & ";database=FILMS"
.RecordSource = "select * from FILMS where [TITLE] LIKE '%" & Trim(Text1.Text) & "%'"

End With


Adodc1.Refresh

If Adodc1.Recordset.RecordCount = 0 Then

Else
Label3.Visible = True
Label4.Visible = True
End If



Set DataGrid1.DataSource = Adodc1



With DataGrid1

.ClearFields
.ReBind
.Refresh

End With

End Sub

I tried to do exactly the same thing in Visual Studio 2005
but nothing works
1.I can't connect with ADODC
2.I can't execute the Query not even if I use the Dataset connection that the Database Walkthrough shows
3.The text in the textbox can't be included in the query FillBy

Someone Help Me Please
Mar 27 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.