Replace function for double quotation mark.

E

Enjoy Life

Okay, with your guys' help, I have been able to pinpoint the problem.
It is NOT in the SQL statement.

The SQL is updating it just fine. It is in the following code on a
different page to modify the values.

<input type="text" name="ProductName" size="50"
value="<%=ProductName%>"></input>

Since there is a double quotation in the value of ProductName, the
value ends there. How do I go about this? This is my last post for
the day as I am out the door. I'll check back tomorrow.

Thanks for all the help so far, you guys are great!

-Darren
 
E

Enjoy Life

Ray you have been a big help. Without you, I would have given up and
wouldn't have realized that this was a stupid mistake on my part. I
misapplied the blame of the error. The error wasn't in the SQL
statement or ACCESS, but an HTML tag. The HTML <input> tag with the
value property. The value property terminates when it hits the ".
This is a simple fix, that I am not sure about. I am running out the
door, or I would try a few things that come to mind. If anyone knows
the simple solution, I will do that first thing tomorrow. Thanks for
everything guys.

-Darren
 
R

Ray at

I posted this suggestion an hour and a half ago. In the future, please read
the posts and give honest answers. (For your own benefit, not mine!) For
example:

Ray: Where are you seeing that this value is being truncated? Are you
looking in the database itself?

Enjoy Life: Yes, it is truncated in the database.

Ray at work
 
R

Ray at

No problem. I'm glad it's worked out. See my earlier post for a
quote-substitution solution.

Ray at work
 
B

Bob Barrows [MVP]

From what I can see, it should work fine. The response.written string IS the
string being sent to Access for execution.

Without working with it firsthand, I am not going to figure this out.

I would suggest, however, that you parameterize this query. While you're in
Access with the query shown in the SQL View of the query builder, replace
all of your literals with parameter markers, like this:

Update Products set ProductName = [qProdname], ShadeID = [qShade], Notes
=[qNotes], CategoryID = [qCat],
MakeShown = [qMS], Make = [qM], Ten_Sixteen = [qTen], Cotton_Poly = [qPoly],
MFG_Shown = [qMFGS], MFG = [qMFG], Weight = [qWt], SizeProduct = [qSize],
CasePack =
[qPack], UnitCost = [qCost], UnitPrice = [qPrice], QuantityPerUnit = [qQty],
ProductNo = [qProdno], SupplierID = [qSupID] where ProductID = [ProdID]

Save this query as qUpdProduct

Then, in your vbscript code, do this:

ProductID = Request.Form("ProductID")
SupplierID = Request.Form("SupplierID")
ProductName = trim(Request.Form("ProductName"))
'etc.

cnLinens.qUpdProduct ProductName, ...,SupplierID,ProductID

The parameters must be supplied in the order in which they appear in the
saved query.

HTH,
Bob Barrows
 
B

Bob Barrows [MVP]

Give him a break: he didn't know where to look. The only place he was
looking was in the database so that is the only answer he knew to give you
at the time he answered it.

Now, hopefully, he'll be better able to give a more relevant answer ...

Bob
 
R

Ray at

Bob Barrows said:
Give him a break: he didn't know where to look. The only place he was
looking was in the database

But it was never truncated in the database to begin with, so what I was
saying is that he didn't look in the database. He looked at the web page
displaying the data.

Ray at work
 
B

Bob Barrows [MVP]

Ray at said:
But it was never truncated in the database to begin with, so what I
was saying is that he didn't look in the database. He looked at the
web page displaying the data.

Ray at work

Oh yeah! You're right! My bad.

Anyways, I think he's just learned a lesson.

Bob
 
B

Bob Barrows [MVP]

Enjoy said:
Okay, with your guys' help, I have been able to pinpoint the problem.
It is NOT in the SQL statement.

The SQL is updating it just fine. It is in the following code on a
different page to modify the values.

<input type="text" name="ProductName" size="50"
value="<%=ProductName%>"></input>
value="<%=Server.HTMLEncode(ProductName)%>"></input>

Bob Barrows
 
M

[MSFT]

Hello,

I execute following command in both of Access and ASP, they all worked
correct( " is included):

Update Products set ProductName = '- Pillowcases T-180 Percale 55/45 42x34
w/ 2 " Hem', ShadeID = '1', Notes = ' ', CategoryID = '13', MakeShown = '',
Make = '', Ten_Sixteen = '', Cotton_Poly = '', MFG_Shown = '', MFG = '',
Weight = '', SizeProduct = '', CasePack = '6', UnitCost = '11.88',
UnitPrice = '16.5', QuantityPerUnit = 'DZ', ProductNo = '03717500',
SupplierID = '31' where ProductID = 566


Here is my ASP code:

dim cn

set cn=server.CreateObject("ADODB.Connection")

cn.Open "provider=microsoft.jet.oledb.4.0;data source=c:\db1.mdb;"

dim cmdstr

cmdstr="Update Products set ProductName = '- Pillowcases T-180 Percale
55/45 42x34 w/ 2 "" Hem', ShadeID = '1', Notes = ' ', CategoryID = '13',
MakeShown = '', Make = '', Ten_Sixteen = '', Cotton_Poly = '', MFG_Shown =
'', MFG = '', Weight = '', SizeProduct = '', CasePack = '6', UnitCost =
'11.88', UnitPrice = '16.5', QuantityPerUnit = 'DZ', ProductNo =
'03717500', SupplierID = '31' where ProductID = 516"

cn.Execute cmdstr

If you try above code in your ASP page, what is the result?

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
E

Enjoy Life

Thank you Bob! That did the trick.

Thank you to all that have helped me on this one. A very simple
solution to an elusive problem. It would have helped everyone if I
wouldn't have misdiagnosed the problem to begin with. Thanks again.

-Darren
 
E

Enjoy Life

I appologize. Sorry for wasting your time. And thanks for all the
help that was given.

-Darren
 
R

Ray at

Don't worry about it, really! I didn't mean to sound attacking; I'm just
not a tactful person. [: Don't hesitate to post future questions.

Ray at work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top