Ask a Question related to ASP Database, Design and Development.
-
scott #1
update statement with DSN works, DSN-less fails
the following SQL statement works when executing via a DSN connection
but fails when using the DSN-less method.
sql statement:
UPDATE tblApplicants SET ApplicantName='116th Pennylvania Volunteer
Infantry', ContactName='John Smith', Address='1234 S. Main St. #23',
City='Cityville ', State='CA', Zip='12345-',
DaytimePhone='(555)555-5555', PhoneExt='',
EveningPhone='(555)555-5555', Email='jsmith@whatever.com',
PreviousEntry=1, YearsInParade=1, Accepted=1, Insurance=1,
Commercial=0, Year=2003, EntryScript='blah, blah, blah. more blah',
NumberInGroup=45, DblPull=1, Wagon=1, PartnerDblPull=0, Horses=0,
LineUpFootage=0, Description='116th blah text text - blah.blah.blah
,blah and blah', Notes='', UnitSizeBanners='', DivisionID=1, Active=1
where ApplicantID=283;
asp code:
var oConn = Server.CreateObject('ADODB.Connection');
oConn.Mode = 3;
oConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=F:\\myDir\\website\\myDB.mdb";
oConn.Open();
oRS = oConn.Execute(sql);
.....
error returned:
Microsoft JET Database Engine error '80040e14'
Syntax error in UPDATE statement.
platform:
win2k, access 2k, ADO 2.6
i can read from the DB just fine and i can also execute other UPDATE
SQL statements elsewhere in my application. i have set IUSR_machine
read/write permissions to the db dir + file, read thru the many posts
regarding this error and have not found a solution. exactly what is
the difference between using DSN/DSN-less w/ the provided sql
statement?!?!?!
any help would be extremely appreciated!!!
cheers,
scott
scott Guest
-
Update fails on CF 7.0, works on CF 5.0
I'm not sure what's going on. The UPDATE below works with CF5.0 with MS Access ODBC, but fails with CF 7.0 with MS Access with Unicode. I first... -
IsPlaying() works on one SWF and fails on another?
On a webpage with a Flash clip I use javascript which checked the value of window.document.movie.IsPlaying() to see if the clip is still palying and... -
sql statement works in query analyzer but not in asp/ado?
I am new to asp/ado (well and sql server)... this has been driving me mad for hours now. I have created an SQL statment using access query design. I... -
VPN works on dial-up but fails through LAN
Running Windows XP Pro on my laptop, when I activate VPN to access my coporate server, it works flawlessly if I dial-up directly from the laptop... -
if statement always fails !!!
"The Script Smiths - PHP/PERL Developers" <mh2@isis.co.za> wrote in message news:<3efaa8fa$0$237@hades.is.co.za>... That was it. Sometimes you... -
Bob Barrows #2
Re: update statement with DSN works, DSN-less fails
This type of error usually means you've used a reserved word for one of your
column or table names. Let's see ... yep, "Year" is a reserved word and
should be avoided object names. If you can't change the column name, you
will have to remember to surround it with brackets []:
" ... [Year] = .... "
Why does it work with ODBC? I'm not sure - it should be reserved with ODBC
as well, at least, according to this page:
[url]http://www.aspfaq.com/show.asp?id=2080[/url]
BTW, you should not be using the recordset object when running an action
query that returns no records. In fact, you shold be telling ADO not to
create a recordset object by using the adExecuteNoRecords constant like
this:
oConn.Execute(sql,,129);
/*I almost didn't notice you were using jscript - I was going to comment on
the lack of the Set keyword ...*/
129 is the combination of two constants:
1 = adCmdText which tells ADO that you are executing a sql statement passed
as a string
128 = adExecuteNoRecords
1 + 128 = 129
scott wrote:> the following SQL statement works when executing via a DSN connection
> but fails when using the DSN-less method.
>
>
> sql statement:
> Commercial=0, Year=2003, EntryScript='blah, blah, blah. more blah',
Bob Barrows Guest
-
scott #3
Re: update statement with DSN works, DSN-less fails
thank you bob!! this did the trick...
"Bob Barrows" <reb_01501@yahoo.com> wrote in message news:<ubV0RERZDHA.1640@TK2MSFTNGP10.phx.gbl>...> This type of error usually means you've used a reserved word for one of your
> column or table names. Let's see ... yep, "Year" is a reserved word and
> should be avoided object names. If you can't change the column name, you
> will have to remember to surround it with brackets []:
>
> " ... [Year] = .... "
>
> Why does it work with ODBC? I'm not sure - it should be reserved with ODBC
> as well, at least, according to this page:
> [url]http://www.aspfaq.com/show.asp?id=2080[/url]
>
> BTW, you should not be using the recordset object when running an action
> query that returns no records. In fact, you shold be telling ADO not to
> create a recordset object by using the adExecuteNoRecords constant like
> this:
>
> oConn.Execute(sql,,129);
> /*I almost didn't notice you were using jscript - I was going to comment on
> the lack of the Set keyword ...*/
>
> 129 is the combination of two constants:
> 1 = adCmdText which tells ADO that you are executing a sql statement passed
> as a string
> 128 = adExecuteNoRecords
> 1 + 128 = 129
>
>
> scott wrote:> > the following SQL statement works when executing via a DSN connection
> > but fails when using the DSN-less method.
> >
> >
> > sql statement:
> > Commercial=0, Year=2003, EntryScript='blah, blah, blah. more blah',scott Guest



Reply With Quote

