Hi Guys. Ok, I am beginning to think I am REALLY dense.
I can't get the data to enter... even if I copy and paste what you have entered here. So the question still remains, what in the name of the Incarnations am I doing wrong? I know the command I am using is fine... I string 3 or 4 insert commands together, and when I query the database, there it is. When I read the LanguageReference, I appear to be doing everything correctly. I have: editfield1, editfield2, a popup menu (known in code as popgroup). My database is known as dbsecurity. (had to change the name from my last posting due to ... other... issues that I thought might be my problem...) I'm using Realbasic 2006 release 4. When I add Mr. Pieterciel's version, with a copy and paste, the compiler gives me a syntax error, but I appear to have all of the single and double quotes where they are supposed to be. I didn't miss anything as far as I can tell. All I want to do is take the information in each field and add it to my realsqldatabase. Help (v2.0) Sincerely, > > From: Bart Pietercil <[EMAIL PROTECTED]> > Date: 2006/10/04 Wed PM 07:10:05 EST > To: REALbasic NUG <[email protected]> > Subject: Re: re; adding data to a real sql database > > > > > db.sqlexecute ("Insert into users (username,password,priority) > > Values "_ > > +"(editfield1.text+','+editfield2.text+','+popgroup)") > > > I think this line should be: > > dim aQuery, test as string > > aQuery = "Insert into users(username,password,priority)Values('" + > editfield1.text +"','"+editfield2.text + "','"+popgroup"');" // watch > out there are ' before and/or after the " > db.sqlexecute(aQuery) > if not db.error then > //all is well > ..... > else > MsgBox db.ErrorMessage > test = "" //this line is just there so you can put a breakpoint on > it. This way when things go wrong, the debugger will open with > aQuery available for inspection (and copying to your sqltool) > end if > > hth > > Bart Pietercil > _______________________________________________ > Unsubscribe or switch delivery mode: > <http://www.realsoftware.com/support/listmanager/> > > Search the archives of this list here: > <http://support.realsoftware.com/listarchives/lists.html> > _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html>
