[Net1.1SP1][OledbCommand]

  • Thread starter Andrea Raimondi
  • Start date
A

Andrea Raimondi

Hello.

I'm doing a WebService using ASP.NET with an Access database.
Nothing really fancy, I just want to try and see what I can get to.

Using an Access database(no please, don't tell me that MS is pushing
towards MSDE, since I'm going to have a hoster so no luck with it).

I'm trying to use parameters and looking on Google Groups I found out
that I have to use question marks(?) for parameters.

So far so good, I mean, no problems in using unnamed parameters,
this service isn't complicated so - well - I can live with this :)

But if I'm here, then it's likely there's a problem... and indeed
there's one, since the "parameters" collection of the OleDBCommand
doesn't get updated. Sigh.

The source of my problem likely relies in the SQL statement I'm writing,
which should be like this:

Insert Into FAQS values(Question,Answer)

That I've translated into:

Insert Into FAQS values(?,?)

But as I said, parameters collection doesn't fill in with the two
items and I'm clueless about what to do.

Any ideas?

Cheers,

Andrew
 
C

Cor Ligthert [MVP]

Andrea,

Yesterday I have tried to make a sample that fullfils the most problems that
I have seen in this newsgroup with OleDB and Access. The problem is that it
is become therefore an extended sample.

One of the main thing with OleDB and Access is that the name of the
parameter is from not any importantcy. The sequence of use accoording as
they are in the SQL string is what has to be done.
As well have you sometimes to give one more parameter than needed at the
end. I have not yet find why.

It is a windowsform sample, however in fact is the form only to show the
results, it could have been as well aspnet.

http://www.vb-tips.com/default.aspx?ID=87057b89-a61c-44b9-bbfa-f80b8e80394e

It is brand new, so if you think that I made errors, than please reply
those.

There are by the way more simpler tips with OleDbParameters on our website.

I hope this helps,

Cor
 

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

Top