![]() |
|
[.NET] Searched The Whole Internet For This ACCESS DATABASE And VB.NET Connect ERROR!! - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] Searched The Whole Internet For This ACCESS DATABASE And VB.NET Connect ERROR!! (/showthread.php?tid=3505784) |
Searched The Whole Internet For This ACCESS DATABASE And VB.NET Connect ERROR!! - scoder - May 26, 2013 ![]() Source : PHP Code and Tested This : PHP Code Working on Access Database (Office 2007) ![]() Any Help ? asked Friends in HF and google, Yahoo, Bing And everything!! Thanks in advance. * - C3ol - May 26, 2013 "Insert Into db (name, id) Values('a', '1')" * - Cody8295 - May 26, 2013 Yeah, try putting single quotes before/after the double quotes before your variables. Like this: cmd.CommandText = "INSERT INTO table([iD], [name]) VALUES ('" & Me.txtid.Text & "','" & Me.txtname.Text & "')" * - x64 - May 26, 2013 (May 26, 2013 08:15 AM)Cody8295 Wrote: Yeah, try putting single quotes before/after the double quotes before your variables. Like this: No that's a very bad habit. Just use parameters for inserting variables. * - scoder - May 26, 2013 (May 26, 2013 07:15 AM)C3ol Wrote: "Insert Into db (name, id) Values('a', '1')" Got the Same Error another solution ?.. Thanks in advance (May 26, 2013 08:15 AM)Cody8295 Wrote: Yeah, try putting single quotes before/after the double quotes before your variables. Like this: ExecuteNonQuery Error Same Error .. Thanks For Helping anyways..🤨 (May 26, 2013 08:27 AM)Lambik Wrote: No that's a very bad habit. Just use parameters for inserting variables. Hey man can you help me with that..? Thank you * - x64 - May 26, 2013 (May 26, 2013 08:49 AM)scoder Wrote: Got the Same Error another solution ?.. When using parameters you're a supposed to replace the word you've added. So not : Code cmdadd.Parameters.AddWithValue("ID", txtid.Text)But Code cmdadd.Parameters.AddWithValue("@ID", txtid.Text)* - scoder - May 26, 2013 (May 26, 2013 08:52 AM)Lambik Wrote: When using parameters you're a supposed to replace the word you've added.So the Code Will Be Like This : PHP Code But Still Getting The Same Error.. :/ * - Cody8295 - May 26, 2013 (May 26, 2013 08:27 AM)Lambik Wrote: No that's a very bad habit. Just use parameters for inserting variables. ... This isn't PHP, you can't do it like that. * - x64 - May 26, 2013 (May 26, 2013 09:53 AM)Cody8295 Wrote: ... This isn't PHP, you can't do it like that. I know it's not PHP. When using queries in ODB, you can use parameters for data. Look at my previous post It's injection safe. |