468,292 Members | 1,456 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,292 developers. It's quick & easy.

Help to store in Ms Access

hi All

Q1.
i want to store string like

" vinay's home " in access database using vb.net

but my query get dropped because of " ' " in string input

and it become

Qry="Insert into info values('vinay's home')

i got error in this case so any one knows

how can i resolve it ??
Q2
is there any way to create store procedure for Access database if yes
than how ?
Waiting for Reply

Thanks in advance

With Regards

Vinay Patel

Apr 14 '07 #1
3 1018
On 13 Apr 2007 22:39:39 -0700, Vinay Patel wrote:
hi All

Q1.
i want to store string like

" vinay's home " in access database using vb.net

but my query get dropped because of " ' " in string input

and it become

Qry="Insert into info values('vinay's home')

i got error in this case so any one knows

how can i resolve it ??

Q2
is there any way to create store procedure for Access database if yes
than how ?

Waiting for Reply

Thanks in advance

With Regards

Vinay Patel
Two options
1) Use parameterized queries (OleDB commands using OleDbParameters)
2) Replace all ' with '' using the String.Replace method
--
Bits.Bytes
http://bytes.thinkersroom.com
Apr 14 '07 #2
Hi Vinay

http://msdn.microsoft.com/library/de.../acfundsql.asp

http://msdn.microsoft.com/library/de...l/acintsql.asp

http://msdn.microsoft.com/library/de...l/acadvsql.asp

I hope this helps a little bit?

Cor
"Vinay Patel" <pa*****************@gmail.comschreef in bericht
news:11**********************@w1g2000hsg.googlegro ups.com...
hi All

Q1.
i want to store string like

" vinay's home " in access database using vb.net

but my query get dropped because of " ' " in string input

and it become

Qry="Insert into info values('vinay's home')

i got error in this case so any one knows

how can i resolve it ??
Q2
is there any way to create store procedure for Access database if yes
than how ?
Waiting for Reply

Thanks in advance

With Regards

Vinay Patel

Apr 14 '07 #3

Open up the database.

Add a new Query. Change the type to "Updateable" I think it is.

Start out with something simple like

qryCustomerUpdate

Maybe supply 2 parameters

pCustomerID , pLastName

and the query is

Update Customer Set LastName = pLastName where CustomerID = pCustomerID

the last time i did this (circa 2001 I think) i used to put 'p' s in for
parameters, to increase readability, since there is no @variableName like in
sql server.

It's something along those lines.

"Vinay Patel" <pa*****************@gmail.comwrote in message
news:11**********************@w1g2000hsg.googlegro ups.com...
hi All

Q1.
i want to store string like

" vinay's home " in access database using vb.net

but my query get dropped because of " ' " in string input

and it become

Qry="Insert into info values('vinay's home')

i got error in this case so any one knows

how can i resolve it ??
Q2
is there any way to create store procedure for Access database if yes
than how ?
Waiting for Reply

Thanks in advance

With Regards

Vinay Patel

Apr 16 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by \jason via DotNetMonster.com\ | last post: by
32 posts views Thread by robert d via AccessMonster.com | last post: by
3 posts views Thread by Wired Hosting News | last post: by
8 posts views Thread by skumar434 | last post: by
2 posts views Thread by hcaptech | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.