Author |
Topic  |
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
Posted - 13 February 2002 : 19:43:03
|
TerryG,
It didn't take that much time, really. I had everything done in my own Web site, so it just a question of a couple of minor changes here and there to test my own ideas on this issue. Don't worry about it. I just like to help and I'm not disappointed by your choice. One should choose the best solution for each problem. When you provide help to someone you're just providing another choice to be added to the panoplia of choices for the "helpee" (sorry for the expression ) to choose from.
So, don't feel bad about your choice and I assure you that it didn't take that much work .
To finalize, answering your question. With an ASP script you just generate code to generate a page. Whether that page contains HTML or Javascript or VbScript or whatever it makes no difference. That was my point all along and that's what I tried to certify myself of. So, yes I would think you could use response.write to write the code into a onClick=FunctionName().
Edited by - ruirib on 13 February 2002 19:58:35 |
 |
|
Steve D.
Average Member
  
USA
640 Posts |
Posted - 19 February 2002 : 16:04:24
|
I'm having a similar problem, but it is when I'm storing a string in to the database that contains an apostrophe, I'm getting the following error.
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ''It's All Swing ')'.
/test_add_class_student.asp, line 110
To test it out go to http://www.stevedandrebecca.com/test_registration.asp
---------------------------------------- Badges? We don't need no stinking badges |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
Posted - 19 February 2002 : 18:00:11
|
quote:
I'm having a similar problem, but it is when I'm storing a string in to the database that contains an apostrophe, I'm getting the following error.
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ''It's All Swing ')'.
/test_add_class_student.asp, line 110
To test it out go to http://www.stevedandrebecca.com/test_registration.asp
---------------------------------------- Badges? We don't need no stinking badges
Well that's a new one for me. Storing a string has never been a problem. Do you want to publish the code you are using to do that?
|
 |
|
xMANIGHTx
Junior Member
 
Italy
191 Posts |
Posted - 20 February 2002 : 08:49:20
|
Steve, whene you store a string in the DB using dynamic SQL (not stored procs) you have to replace ' with ''.. and also you should replace % with ''%'' if I don't get wrong. By the way, when you're building your SQL string (INSERT or UPDATE) just do this: strToInsert = Replace(strToInsert,"'",'')
TerryG use: onClick="function('something I\'ll put here')" That's the correnct syntax if you put the \' inside. So don't invert " with ' that's all 
Distractly yours... manight@audiopro.it |
 |
|
Steve D.
Average Member
  
USA
640 Posts |
Posted - 20 February 2002 : 10:21:48
|
quote:
Steve, whene you store a string in the DB using dynamic SQL (not stored procs) you have to replace ' with ''.. and also you should replace % with ''%'' if I don't get wrong. By the way, when you're building your SQL string (INSERT or UPDATE) just do this: strToInsert = Replace(strToInsert,"'",'')
Didn't know about the %.
I've got it to work, but now when I retrieve the value it's appears as it''s
So what I've done is done another replace when the value is retrieved.
or is
strToInsert = Replace(strToInsert,"'",'')
the same as
strToInsert = Replace(strToInsert,"'","''")
---------------------------------------- Badges? We don't need no stinking badges |
 |
|
xMANIGHTx
Junior Member
 
Italy
191 Posts |
Posted - 20 February 2002 : 14:20:01
|
Maybe it was my fault in displying chars. I'll make duoble apex in red " And apostrophe in black '
strToInsert = Replace(strToInsert,"'","''")
This way it MUST store it correctly in the DB and when you retrieve it with a select you don't need any additional coding you'll get back the string in the correct format in your rsTemp("STRING").
If you are using stored procedures and pass the string as a parameter you shouldn't do any replace at all, beacause the string is passed between variables.
Hope this may help somehow
Distractly yours... manight@audiopro.it |
 |
|
Topic  |
|