|
-
Feb 7th, 2003, 08:08 AM
#1
Thread Starter
Sleep mode
darn it , no action at all [UN -Resolved yet]
Hell , I dunno what the **** is going wrong with this code , no action at all .I hate it .Basically , I want to search my database.anyone has example or a link ....thanx for any help .
VB Code:
Private Sub Button2_Click(ByVal sender As System.Object _
, ByVal e As System.EventArgs) Handles Button2.Click
Dim MyConnection1 As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
MyPath & ";Jet OLEDB:Database Password=" & MyPassword)
Dim myDataReader As OleDbDataReader
Dim txt As String = "SELECT * FROM MyTab WHERE C_URL LIKE '" & TextBox7.Text.Replace("'", "''") & "*'"
Dim myOleDbCommand = New OleDbCommand(txt, MyConnection1)
MyConnection1.Open()
myDataReader = myOleDbCommand.ExecuteReader()
Do While (myDataReader.Read)
If (myDataReader.IsDBNull(0)) Then
MsgBox(myDataReader.GetString(1))
Console.Write("N/A" + Chr(10))
MsgBox("no data")
Else
Console.Write(myDataReader.GetInt32(4).ToString() + Chr(10))
MsgBox(myDataReader.GetInt32(4).ToString() + Chr(10))
End If
Loop
myDataReader.Close()
MyConnection1.Close()
End Sub
Last edited by Pirate; Feb 7th, 2003 at 11:31 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|