Click here to Skip to main content
15,885,366 members
Articles / Programming Languages / Visual Basic

How to read any string from access database using adodb

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
29 Dec 2012CPOL 0  
Never ever concatenate data directly to your SQL statement. Instead use OleDbParameter[^].So your query part should look like following:cmdOLEDB.CommandText = "SELECT usern FROM Aut WHERE usern = ?"cmdOLEDB.Parameters.Add("username", OleDbType.VarChar, 50).Value = textbox1.Text;...

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
29 Dec 2012Vishal I. Sahuji 1 alternative  
I want to read string from one column but when i try this one i got error that is "Data type mismatch in criteria expression."cmdOLEDB.CommandText = "SELECT usern FROM Aut WHERE usern=" & textbox1.TextcmdOLEDB.Connection = cnnOLEDBDim rdrOLEDB As OleDbDataReader =...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
Europe Europe
Biography provided

Comments and Discussions