Migrating Access Database to use ASP
Migrating Access Database to use ASP
am 12.11.2004 08:24:00 von A P
Hi!
I'm having problem in doing this. I have fields on my table that has a
question mark (e.i. Cleared?) and when I try to include this on a SELECT
statement on ASP. it gives an error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect
/test/list.asp, line 27
where line 27 is where I open a recordset
How can I solve this?
Me
Re: Migrating Access Database to use ASP
am 12.11.2004 12:00:53 von McKirahan
"A P" wrote in message
news:e4FI9hIyEHA.748@TK2MSFTNGP14.phx.gbl...
> Hi!
>
> I'm having problem in doing this. I have fields on my table that has a
> question mark (e.i. Cleared?) and when I try to include this on a SELECT
> statement on ASP. it gives an error:
>
> Error Type:
> Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
> [Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect
>
> /test/list.asp, line 27
>
> where line 27 is where I open a recordset
>
> How can I solve this?
>
> Me
Show us your SQL.
Re: Migrating Access Database to use ASP
am 12.11.2004 18:01:55 von Curt J Raddatz
The questiuon mark (?) in SQL statements is used to identify variables so it
is looking at Clear? and assuming the field name is Clear and the ? is some
varible. Since Clear is not a valid field, you get the error. You *may* be
able to put the field in brackets (like [Clear?]) but I would strongly
recommend changing the field name, even if it means changing other Access
database code.
"A P" wrote in message
news:e4FI9hIyEHA.748@TK2MSFTNGP14.phx.gbl...
> Hi!
>
> I'm having problem in doing this. I have fields on my table that has a
> question mark (e.i. Cleared?) and when I try to include this on a SELECT
> statement on ASP. it gives an error:
>
> Error Type:
> Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
> [Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect
>
> /test/list.asp, line 27
>
> where line 27 is where I open a recordset
>
> How can I solve this?
>
> Me
>
>
>
Re: Migrating Access Database to use ASP
am 16.11.2004 09:05:54 von A P
SELECT tblpo.POID, tblpo.PONumber, tblsupplyme.supplymeName,
[tblpo.Cleared?] AS Clear FROM tblsupplyme INNER JOIN tblpo ON
tblsupplyme.SupplymeID = tblpo.SupplymeName WHERE (((tblpo.[Cleared?])<>-1))
ORDER BY tblpo.POID DESC
"McKirahan" wrote in message
news:FJ0ld.78403$HA.447@attbi_s01...
> "A P" wrote in message
> news:e4FI9hIyEHA.748@TK2MSFTNGP14.phx.gbl...
> > Hi!
> >
> > I'm having problem in doing this. I have fields on my table that has a
> > question mark (e.i. Cleared?) and when I try to include this on a SELECT
> > statement on ASP. it gives an error:
> >
> > Error Type:
> > Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
> > [Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect
> >
> > /test/list.asp, line 27
> >
> > where line 27 is where I open a recordset
> >
> > How can I solve this?
> >
> > Me
>
> Show us your SQL.
>
>
Re: Migrating Access Database to use ASP
am 16.11.2004 12:20:10 von McKirahan
"A P" wrote in message
news:ewWoBM7yEHA.2876@TK2MSFTNGP12.phx.gbl...
> SELECT tblpo.POID, tblpo.PONumber, tblsupplyme.supplymeName,
> [tblpo.Cleared?] AS Clear FROM tblsupplyme INNER JOIN tblpo ON
> tblsupplyme.SupplymeID = tblpo.SupplymeName WHERE
(((tblpo.[Cleared?])<>-1))
> ORDER BY tblpo.POID DESC
>
>
> "McKirahan" wrote in message
> news:FJ0ld.78403$HA.447@attbi_s01...
> > "A P" wrote in message
> > news:e4FI9hIyEHA.748@TK2MSFTNGP14.phx.gbl...
> > > Hi!
> > >
> > > I'm having problem in doing this. I have fields on my table that has a
> > > question mark (e.i. Cleared?) and when I try to include this on a
SELECT
> > > statement on ASP. it gives an error:
> > >
> > > Error Type:
> > > Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
> > > [Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect
> > >
> > > /test/list.asp, line 27
> > >
> > > where line 27 is where I open a recordset
> > >
> > > How can I solve this?
> > >
> > > Me
> >
> > Show us your SQL.
> >
1) Please do not top post.
2) Can you rename the field(s) to not have a "?" in their name(s)?
3) Have you gotten a simple SQL statement to work?
SELECT [tblpo.Cleared?] FROM tblpo
(I created a test table and the above worked.)
4) Have you used MS-Access Query facility to test your SQL?
5) Try using "AS Cleared" instead of "AS Clear";
(perhaps "Clear" is a reserved word.)
Re: Migrating Access Database to use ASP
am 17.11.2004 03:46:03 von A P
1. Why not top post?
2. No since users already using this long time ago that is hard for us to
change it
3. yes, thru simple select statement but still it didn't work
4. yes and its working
5. I've tried it and still it doesn't work
"McKirahan" wrote in message
news:Knlmd.45604$5K2.26929@attbi_s03...
> "A P" wrote in message
> news:ewWoBM7yEHA.2876@TK2MSFTNGP12.phx.gbl...
> > SELECT tblpo.POID, tblpo.PONumber, tblsupplyme.supplymeName,
> > [tblpo.Cleared?] AS Clear FROM tblsupplyme INNER JOIN tblpo ON
> > tblsupplyme.SupplymeID = tblpo.SupplymeName WHERE
> (((tblpo.[Cleared?])<>-1))
> > ORDER BY tblpo.POID DESC
> >
> >
> > "McKirahan" wrote in message
> > news:FJ0ld.78403$HA.447@attbi_s01...
> > > "A P" wrote in message
> > > news:e4FI9hIyEHA.748@TK2MSFTNGP14.phx.gbl...
> > > > Hi!
> > > >
> > > > I'm having problem in doing this. I have fields on my table that has
a
> > > > question mark (e.i. Cleared?) and when I try to include this on a
> SELECT
> > > > statement on ASP. it gives an error:
> > > >
> > > > Error Type:
> > > > Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
> > > > [Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect
> > > >
> > > > /test/list.asp, line 27
> > > >
> > > > where line 27 is where I open a recordset
> > > >
> > > > How can I solve this?
> > > >
> > > > Me
> > >
> > > Show us your SQL.
> > >
>
> 1) Please do not top post.
>
> 2) Can you rename the field(s) to not have a "?" in their name(s)?
>
> 3) Have you gotten a simple SQL statement to work?
>
> SELECT [tblpo.Cleared?] FROM tblpo
>
> (I created a test table and the above worked.)
>
> 4) Have you used MS-Access Query facility to test your SQL?
>
> 5) Try using "AS Cleared" instead of "AS Clear";
>
> (perhaps "Clear" is a reserved word.)
>
>
Re: Migrating Access Database to use ASP
am 17.11.2004 12:15:44 von McKirahan
"A P" wrote in message
news:uH2s99EzEHA.4004@tk2msftngp13.phx.gbl...
> 1. Why not top post?
[snip]
Why should I not top-post?
http://www.html-faq.com/etiquette/?toppost
"Top-posting severely inhibits others from understanding the conversation,
because the context of the conversation is lost."
However ... http://www.mcse.ms/message345256.html
Re: Migrating Access Database to use ASP
am 17.11.2004 13:15:23 von reb01501
A P wrote:
> 2. No since users already using this long time ago that is hard for
> us to change it
Yes, that's the problem with Access: it allows users to develop bad habits,
by handling the results of those bad habits behind the scenes. As a
developer, you have to implement the same techniques to handle the bad
habits of the users who created the databases.
> 3. yes, thru simple select statement but still it didn't work
Could you show the code that made it not work? And explain what "didn't
work" means? If you got an error message, tell us what it is so we don't
have to guess
> 4. yes and its working
This is the problem with top-posting, I don't know what you are replying to
without scrolling down. yes, it does not seem like much time/effort to you,
who only looks at one or two posts per day. But to a person who reads and
replies to hunderds of messages per week (and sometimes per day) this
time/effort gets pretty old, pretty fast.
> 5. I've tried it and still it doesn't work
I will play with this later to see if I can reproduce it.
One thing you can do is create saved queries (views) of your tables in
Access, using standard field names, and use those saved queries from ASP.
Like this:
Create a saved query called qPO using this sql:
SELECT POID,PONumber,[Cleared?] As Cleared FROM tblPO
Then, from ASP, run this query:
sSQL = "SELECT POID,PONumber,Cleared FROM qPO"
set rs = conn.execute(sSQL,,1)
Let us know the results.
An added benefit is that using saved queries is both simpler and more secure
than using dynamic sql from ASP. See these posts:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1& selm=eHYxOyvaDHA.4020%40tk2msftngp13.phx.gbl
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1& selm=ukS%246S%247CHA.2464%40TK2MSFTNGP11.phx.gbl
http://www.google.com/groups?selm=eETTdnvFDHA.1660%40TK2MSFT NGP10.phx.gbl&oe=UTF-8&output=gplain
http://www.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&sel m=e6lLVvOcDHA.1204%40TK2MSFTNGP12.phx.gbl
I also noticed in your first post that your error message
1. references the word "COUNT" which does not appear in the sql contained in
your follow-up message. If you try something different and get a new error
message, show us the new error message, please.
2. comes from the ODBC provider, which has been deprecated by Microsoft. You
should use the native Jet provider to obtain more functionality and
robustness. Your connection string should look like this:
conn.open "provider=microsoft.jet.oledb.4.0;" & _
"data source=p:\ath\to\database.mdb"
HTH,
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"