Click here to Skip to main content
15,846,004 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Multiline Listbox Pin
Dave Kreskowiak21-May-07 17:12
mveDave Kreskowiak21-May-07 17:12 
GeneralRe: Multiline Listbox Pin
The ANZAC21-May-07 18:03
The ANZAC21-May-07 18:03 
GeneralRe: Multiline Listbox Pin
Dave Kreskowiak22-May-07 9:27
mveDave Kreskowiak22-May-07 9:27 
GeneralRe: Multiline Listbox Pin
The ANZAC22-May-07 12:17
The ANZAC22-May-07 12:17 
GeneralRe: Multiline Listbox Pin
Dave Kreskowiak22-May-07 13:15
mveDave Kreskowiak22-May-07 13:15 
GeneralRe: Multiline Listbox Pin
The ANZAC22-May-07 13:19
The ANZAC22-May-07 13:19 
GeneralRe: Multiline Listbox Pin
Dave Kreskowiak23-May-07 16:12
mveDave Kreskowiak23-May-07 16:12 
QuestionProblem with SQL... Pin
CCG321-May-07 12:33
CCG321-May-07 12:33 
I am trying to run an SQL statement to delete a record in my Access 2003 database (in VB.Net 2005).

In my table I have 2 fields.
1. VisitMRNo-DataType=Text
2. VisitDate- DataType=Date/Time and Format=Short Date

Right now, this is the code that I am using…

Dim MR As String
Dim SelectedVisitDate As Date
Dim SQL As String = String.Empty


MR = Me.txtMRNo.Text
SelectedVisitDate = Me.cbobxVisitDate.Text.ToString()


'initialize database connection
Using Connection As New OleDbConnection _
("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Costco\My Documents\Visual Studio Projects\AnesXL.mdb")

'setup SQL command to delete records with matchin info

SQL = "Delete * FROM Pat20VisitDate WHERE VisitMRNo='" & MR & "' AND VisitDate='" & SelectedVisitDate & "'"

Try
'connect to database and delete the records
Connection.Open()
Dim Command As New OleDbCommand(SQL, Connection)
Command.ExecuteNonQuery()

Catch ex As Exception
MsgBox("Delete of Visit Date failed")
Exit Sub
End Try

Once it gets to line Command.ExecuteNonQuery I get an Error: Data type mismatch in criteria expression.

I have watched both of these variables and they look fine in the Watch Window. How can I tell if what I am passing over is in the wrong format?

I really apperciate any help that I can get with this. Thanks!

AnswerRe: Problem with SQL... Pin
Dave Herren21-May-07 13:09
Dave Herren21-May-07 13:09 
GeneralRe: Problem with SQL... Pin
CCG321-May-07 13:22
CCG321-May-07 13:22 
GeneralRe: Problem with SQL... Pin
Dave Herren22-May-07 11:38
Dave Herren22-May-07 11:38 
AnswerRe: Problem with SQL... Pin
Christian Graus21-May-07 14:02
protectorChristian Graus21-May-07 14:02 
GeneralRe: Problem with SQL... Pin
CCG322-May-07 1:56
CCG322-May-07 1:56 
Questionconvert app from windows to PPC? Pin
amatbrewer21-May-07 11:50
amatbrewer21-May-07 11:50 
AnswerRe: convert app from windows to PPC? Pin
Dave Kreskowiak21-May-07 14:14
mveDave Kreskowiak21-May-07 14:14 
GeneralRe: convert app from windows to PPC? Pin
amatbrewer22-May-07 9:36
amatbrewer22-May-07 9:36 
QuestionActivate a Textbox in a other Program Pin
Beginner_HC21-May-07 10:27
Beginner_HC21-May-07 10:27 
AnswerRe: Activate a Textbox in a other Program Pin
Dave Kreskowiak21-May-07 11:00
mveDave Kreskowiak21-May-07 11:00 
GeneralRe: Activate a Textbox in a other Program Pin
Dave Herren21-May-07 12:02
Dave Herren21-May-07 12:02 
GeneralRe: Activate a Textbox in a other Program Pin
Dave Kreskowiak21-May-07 14:16
mveDave Kreskowiak21-May-07 14:16 
GeneralRe: Activate a Textbox in a other Program Pin
Dave Herren26-May-07 4:11
Dave Herren26-May-07 4:11 
GeneralRe: Activate a Textbox in a other Program Pin
Dave Kreskowiak26-May-07 7:18
mveDave Kreskowiak26-May-07 7:18 
AnswerRe: Activate a Textbox in a other Program Pin
Dave Herren26-May-07 4:14
Dave Herren26-May-07 4:14 
QuestionHow can I have my program link to MyApp.msi on my website? Pin
furjaw21-May-07 8:44
furjaw21-May-07 8:44 
AnswerRe: How can I have my program link to MyApp.msi on my website? Pin
Dave Kreskowiak21-May-07 17:08
mveDave Kreskowiak21-May-07 17:08 

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.