|
When i try to access the todo list i get this error
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'IF today() > date_due THEN 'X' ELSE '' ENDIF'.
/todo/default.asp, line 73
i changed jasons code from this
strConnectString = "Provider=MSDASQL;DSN=ToDoLists;UID=dba;PWD=sql"
to this
strConnectString = "Provider=MSDataShape;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("todo.mdb") & ";UID=;PWD="
think i got that right? anyway can anyone shed some light on the problem.
Thanks
Rob
|
|
|
|
|
hmm ... I am thinking that access doesnt support these functions.
today() is not an access function, try changing today() to date() and see if that helps.
- Sage
|
|
|
|
|
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'IF date() > date_due THEN 'X' ELSE '' ENDIF'.
/todo/default.asp, line 73
now i get this error???
is there anyway to contact Jason in this site?
Thanks
Rob
|
|
|
|
|
I dont know Jason, but I know enough to be able to help you. Can you either send me the code from default.asp or send me the project and I will help you fix it real quick. I know how frustrating this all can be so I hope I can do soemthing to help you out and get you quickly on your way. Let me know..
- Sage
|
|
|
|
|
I'm developing a shopping cart project. So to store the values for products during shopping which place would be better and safe, as we have various way database, cookies, and session.
Can ne1 suggest me?
Amit Chowdhury
|
|
|
|
|
hi ,
I think database is the better and safe position to store.
thanks.
|
|
|
|
|
Hi ,
I am using javascript for confirm dialog box in my web application.
I want to do some server side execution and then if there is some error I want to display the confirm dialog box.
but if I am adding it as button1.Attributes.Add("onClick", "return Confirm();"); on body load event .I am getting the message when ever I am clicking the button ,which I don't want .
hope I explained my problem clearly.
can any one help me out?
thanks
sangita
|
|
|
|
|
So, if I understand correctly you want the javascript to be executed only if an error occurs on the server?
What server side language are you using?
theJazzyBrain
Wise is he who asks good questions, not he who gives good answers
|
|
|
|
|
yes that's what I want.
I am using c# as server side language.
thanks
|
|
|
|
|
The onlcick even that you set to that button will not give such functionality.
You have to write the javascript on the client only if the server throws an exception. You will do that within the catch{}
I hope that I helped you.
theJazzyBrain
Wise is he who asks good questions, not he who gives good answers
|
|
|
|
|
Right, you can't intermix server- and client-side code like the original poster wants, but you can tell the server-side code to emit code like that, either by output the code directly or using the Page.RegisterStartupScript method with, like so:
try
{
throw new Exception();
}
catch (Exception ex)
{
string script = string.Format(
"<script language=\"javascript\">alert('{0}');</script>",
ex.Message);
RegisterStartupScript("myUniqueKey1", script);
}
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I have tried with using RegisterStartupScript("myUniqueKey1", script) method, what ever you have written but the alert message is not coming.It is only coming after refreshing the page(reloading the page).
but I want to display the message before refreshing the page.
I have tried with adding submit method in javascript ,but it is not working.
can you suggest something?
thanks
|
|
|
|
|
It matters where you do this. An older implementation of our application web site used to do this and I can assure you it works.
If you add the startup script in your button.Click event handler (or after the appropriate logic in Page_Load) it can work, but you have to write the javascript right. If you right it as a function, something has to call that function. Otherwise, whichout a function "wrapper", the script is executed when it is encountered. Judging by your previous example, you put such code in a function and expected a client-side event on a button or something to fire it. You don't want to do that. If nothing else, at least make the onload event of the BODY call your function, but this would require that you either parse the HTML yourself (very bad!) or make the body a server control (but that's bad too, so just don't put such code in a method).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
thanks a lot.
now it is working fine.Only thing is that when ever I am trying to use the back button of browser it is showing the alert message .which I don't want.
what I think is while using the back button we are reloading the page so the alert message is coming.
can you suggest something to help me out?
thanks.
|
|
|
|
|
Hi,
I m a web developer and i m creating a informational portal.
Potal displays the information/product according to 3-4 criterioa selected
by the user from the database.
My database is MYSQL. And You can consider me as intermediate level PHP developer.
Visitors of my sites are approx. 25,000 per day and they might give 4-5 queries or max. 10 queries per day.
I have decided to make the front end in the PHP and decided to display
result pages from queries depending on user's criteria like price wise, category wise etc.
One of my colleague is suggesting is to change the design.
He wanted me to make on the fly html pages first time any query selected so that that page will be stored in the server and for that particular file
next time it will be taken from the server and need not make query in database. We will have to update the all the pahes when some items has been
updated/deleted/modified.(Right now update is not so frequent.)
But I couldn't diagest the solution.
1)It adds programming complexity.
2)I don't know about how much day i have to spend thinking/proper designing it
3)The new solution only helps database handle less query but According to me
our traffic and query lot is not that much.
4) Current solution works fine for now.
Can GURUS can help me out what should I do?
Thankx in Advance
|
|
|
|
|
I have to agree with you.
Point 1 is absolutely true and could lead to more things begin broken/breakable
however,
If data is rarely changing, then there is and would be a significat advantage to "caching" the outpout in the form of a generated html file. And from a programming aspect, supposing there is only one place that an insert/update/delete action happens, then there is only one place that you need to add some code to re-generate the html files. In this situation, there shouldnt be much of a problem. If I/U/D happens in many places, that is a different issue.
What about using XML as your data source? seems to me that that may solve both problems.
But, another thing to consider is, who is this person and does his opinion outweight yours? Are you wrong in any way and/or does he have any valid points to make?
|
|
|
|
|
Sage,
Thanks for the prompt response.
I was also thinking to looking at the XML solution when I will be equiped with the team.
The person is my collegues and we were discussing healthy for the
sake of website.
I m sure your opinion will be useful in my decision.
Thanks again.
Coolvcguy
|
|
|
|
|
Trying to cerate one of those HTML menues for a site - the kind that has drop-down items-submenues. Those submenues should be in absolute position but next to existing <td> or something, right? But how to figure out the position of that <td> ?
I mean all those - style.top, style.left, height, width, style.height, style.width are blank.
Those other ones - pixeltop, ... are zeros? Is there any place where a control has it's coordinates?
Help!
|
|
|
|
|
Try currentStyle .
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I've got a problem with a form in ASP. The first page accepts two picture files and 3 text fields, and the next page is supposed to save them into an Access database. The pictures save fine, but as soon as I try and use a Request.Form() on the text fields I get an HTTP500 error. Here are the pages:
add_record.asp:
<form method="post" action="write_record.asp" enctype="multipart/form-data"><br />
thumb: <input type="file" name="thumbfield"><br><br />
picture: <input name="picturefield" type="file"><br><br />
make: <input name="makefield" type="text"><br><br />
price: <input name="pricefield" type="text"<>br><br />
description:<br><br />
<textarea name="descriptionfield" cols="50" rows="10"></textarea><br><br />
<input type="submit" name="submit" value="submit"><br />
</form>
write_record.asp:
<% <br />
Set theForm = Server.CreateObject("ABCUpload4.XForm")<br />
Set theField = theForm("picturefield")(1)<br />
<br />
If theField.FileExists and theField.ImageType <> 0 Then<br />
Set cn = Server.CreateObject("ADODB.Connection")<br />
theConn = "dsn=vos;"<br />
cn.Open theConn<br />
Set rs = Server.CreateObject("ADODB.Recordset")<br />
rs.Open "occasions", cn, 1, 3<br />
rs.AddNew<br />
rs("picture").Value = theField.Data<br />
Set theField = theForm("thumbfield")(1)<br />
If theField.FileExists and theField.ImageType <> 0 Then<br />
rs("thumb").Value = theField.Data<br />
end if<br />
<br />
'rs("make").Value = Request.Form("makefield") 'this causes it to die<br />
<br />
rs.Update<br />
rs.Close<br />
cn.Close<br />
End If <br />
<br />
%>
Any help will be appreciated.
Paul
modified 18-Jul-18 11:59am.
|
|
|
|
|
When uploading anything in traditional ASP and using an upload component, you cannot use Request.Form. When you set the enctype attribute on your form tag to "multipart/form-data", the HTTP headers change from what traditionally is sent. The upload component's job is to then process the header for you and give you access to all the form items through it.
Therefore, if you change the following line:
'rs("make").Value = Request.Form("makefield") 'this causes it to die
to
'assuming this is correct... It may be w/o an index. Don't know the component
rs("make").Value = theForm("makefield")(1)
That should help.
Steve
|
|
|
|
|
|
Ok, i think i'm the only person in the world who cant get this to work.
I've got an html page:
<html>
<body>
<TABLE BORDER="1" CELLSPACING="0"
BACKGROUND="border1.gif">
<tr><td>
this is text
</td</tr>
</body>
</html>
I cant get my image to show up as the background for the table. it doesnt show up at all. if i do it works great.
i'm stuck, i have been for an hour...grr.
*.*
cin >> knowledge;
|
|
|
|
|
Maybe it's because the <table> tag isn't closed, or the </td should really be a </td> ?
- Mike
|
|
|
|
|
See this example and change image path for background parameter...
Cheers
|
|
|
|