Click here to Skip to main content
15,901,373 members

Comments by Geoff Williams (Top 16 by date)

Geoff Williams 19-Sep-11 12:02pm View    
The original query was correct. Using OLE, you need to use the '<bold>?/<bold>' character as place holders for the data values.

<pre lang="vb">sql = "SELECT * FROM tblContacts where Name=? and City=?"
da = New OleDb.OleDbDataAdapter(sql, con)
da.SelectCommand.Parameters.AddWithValue("@name", name)
da.SelectCommand.Parameters.AddWithValue("@city", city)</pre>
Geoff Williams 20-Mar-11 13:39pm View    
To be really safe - or at least safe as you can be when using macros - you should wrap the macro definition in brackets as well i.e.

#define AREA(a) ((a) * (a))
Geoff Williams 10-Jan-11 13:14pm View    
If you are looking to use only the date values of your EngageDate field then you could change the last part of your query from

AND EngageDate = @EngageDate

to

AND YEAR(EngageDate) = YEAR(@EngageDate) AND MONTH(EngageDate) = MONTH(@EngageDate) AND DAY(EngageDate) = DAY(@EngageDate)
Geoff Williams 28-Dec-10 12:26pm View    
Deleted
This is of limited use - it only works where the password is a 32-bit integer. It is far better to use parameterised queries as they are of more general use.
Geoff Williams 29-Nov-10 13:23pm View    
Have you tried using a lower colour resolution e.g. Imaging.PixelFormat.Format24bppRgb?