Click here to Skip to main content
15,918,742 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionIs it possible to append a file placed on server using ftp or any option? Pin
all names are already registered so noname18-Oct-07 19:53
all names are already registered so noname18-Oct-07 19:53 
AnswerRe: Is it possible to append a file placed on server using ftp or any option? Pin
Tom Deketelaere18-Oct-07 21:07
professionalTom Deketelaere18-Oct-07 21:07 
QuestionRGB color to system.drawing.color Pin
nishkarsh_k18-Oct-07 19:27
nishkarsh_k18-Oct-07 19:27 
AnswerRe: RGB color to system.drawing.color Pin
Guffa18-Oct-07 19:40
Guffa18-Oct-07 19:40 
GeneralRe: RGB color to system.drawing.color Pin
nishkarsh_k18-Oct-07 19:50
nishkarsh_k18-Oct-07 19:50 
QuestionConstraints on Database Pin
The ANZAC18-Oct-07 17:25
The ANZAC18-Oct-07 17:25 
AnswerRe: Constraints on Database Pin
Paul Conrad28-Oct-07 11:59
professionalPaul Conrad28-Oct-07 11:59 
QuestionHelp with OLEDB error [modified] Pin
Brad^18-Oct-07 13:54
Brad^18-Oct-07 13:54 
Hi, I am coding a login which involoves database verification. For extra security I added a new column to my database and added the extra code accordingly and I am getting this exception..

System.Data.OleDb.OleDbException was unhandled<br />
  ErrorCode=-2147217900<br />
  Message="Syntax error (missing operator) in query expression 'USERID='Brad' PASSID='test'' AND HardwareID='BRAD-8EYRYEUOH4'."<br />
  Source="Microsoft JET Database Engine"


Here is the source for my project:

 Imports System.Data
Imports System.Data.OleDb
Public Class Form1
    Dim mypath = "C:\Temp\mydb.mdb"
    Dim mypassword = ""
    Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & mypath & ";Jet OLEDB:Database Password=abc123" & mypassword)
    Dim cmd As OleDbCommand
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim sql = "SELECT UserID ,PassID, HardwareID FROM MYTAB WHERE USERID='" & TextBox1.Text & "' PASSID='" & TextBox2.Text & "' AND HardwareID='" & TextBox3.Text

        cmd = New OleDbCommand(sql, conn)
        conn.Open()
        Dim dr As OleDbDataReader = cmd.ExecuteReader

        Try
            If dr.Read = False Then
                MessageBox.Show("Authentication failed...")
            Else
               MessageBox.Show("Login successfully...")
            End If
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

        conn.Close()

    End Sub


I am completly stumped and dont understand what I have done wrong? Teh code was working fine until I added this extra bit in: HardwareID='" & TextBox3.Text

Many Thanks




-- modified at 20:44 Thursday 18th October, 2007
AnswerRe: Help with OLEDB error Pin
nlarson1118-Oct-07 16:50
nlarson1118-Oct-07 16:50 
GeneralRe: Help with OLEDB error Pin
Brad^18-Oct-07 23:59
Brad^18-Oct-07 23:59 
GeneralRe: Help with OLEDB error Pin
Tom Deketelaere19-Oct-07 1:38
professionalTom Deketelaere19-Oct-07 1:38 
GeneralRe: Help with OLEDB error Pin
Brad^19-Oct-07 3:14
Brad^19-Oct-07 3:14 
GeneralRe: Help with OLEDB error Pin
Tom Deketelaere19-Oct-07 4:41
professionalTom Deketelaere19-Oct-07 4:41 
Questioncreating class library or dll Pin
askmanojjain18-Oct-07 10:48
askmanojjain18-Oct-07 10:48 
AnswerRe: creating class library or dll Pin
Abhijit Jana18-Oct-07 22:48
professionalAbhijit Jana18-Oct-07 22:48 
QuestionWhy I can not see the MS-DOS window with these codes? Pin
ATC18-Oct-07 8:49
ATC18-Oct-07 8:49 
AnswerRe: Why I can not see the MS-DOS window with these codes? Pin
svanwass18-Oct-07 8:52
svanwass18-Oct-07 8:52 
GeneralRe: Why I can not see the MS-DOS window with these codes? Pin
ATC18-Oct-07 9:16
ATC18-Oct-07 9:16 
QuestionDatagridview combobox column Pin
Rupesh Kumar Swami18-Oct-07 5:59
Rupesh Kumar Swami18-Oct-07 5:59 
QuestionHow to update database using dataset from datagridviewin visual studio 2005 Pin
sivaraman_sankaranarayanan18-Oct-07 5:46
sivaraman_sankaranarayanan18-Oct-07 5:46 
AnswerRe: How to update database using dataset from datagridviewin visual studio 2005 Pin
svanwass18-Oct-07 8:50
svanwass18-Oct-07 8:50 
GeneralRe: How to update database using dataset from datagridviewin visual studio 2005 Pin
sivaraman_sankaranarayanan18-Oct-07 19:00
sivaraman_sankaranarayanan18-Oct-07 19:00 
GeneralRe: How to update database using dataset from datagridviewin visual studio 2005 Pin
svanwass19-Oct-07 9:13
svanwass19-Oct-07 9:13 
QuestionHow to call a Console Exe in vb.net Pin
Vimalsoft(Pty) Ltd18-Oct-07 5:04
professionalVimalsoft(Pty) Ltd18-Oct-07 5:04 
AnswerRe: How to call a Console Exe in vb.net Pin
Paul Conrad18-Oct-07 5:14
professionalPaul Conrad18-Oct-07 5:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.