473,385 Members | 1,353 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

ASP and SQL Statements

Hey,
I have a (hopefully) simple question that has been giving me some
problems. I'm trying to use a simple Select statement to access some
data in an access database.
In access, the sql statement is as follows:

SELECT TPL_Checklist_Master.[1] From TPL_Checklist_Master

However, when I try to do this on an ASP Page, it always causes an
error. I'm assuming this is because of the [] around the field name 1.
(I would change the field names, but I don't have control over that).

I know when trying to use a * in the statement Where field LIKE 'A*' I
needed to replace the * with a %. I was wondering if something similar
had to be done in this case.
I hope my description is clear enought to follow. Thanks in advance
for any help.
Jul 19 '05 #1
6 1252
What error are you getting?

Ray at work

"Aaron" <aa************@hotmail.com> wrote in message
news:16**************************@posting.google.c om...
Hey,
I have a (hopefully) simple question that has been giving me some
problems. I'm trying to use a simple Select statement to access some
data in an access database.
In access, the sql statement is as follows:

SELECT TPL_Checklist_Master.[1] From TPL_Checklist_Master

However, when I try to do this on an ASP Page, it always causes an
error. I'm assuming this is because of the [] around the field name 1.
(I would change the field names, but I don't have control over that).

I know when trying to use a * in the statement Where field LIKE 'A*' I
needed to replace the * with a %. I was wondering if something similar
had to be done in this case.
I hope my description is clear enought to follow. Thanks in advance
for any help.

Jul 19 '05 #2
Oh, and what kind of database is it?

Ray at work

"Aaron" <aa************@hotmail.com> wrote in message
news:16**************************@posting.google.c om...
Hey,
I have a (hopefully) simple question that has been giving me some
problems. I'm trying to use a simple Select statement to access some
data in an access database.
In access, the sql statement is as follows:

SELECT TPL_Checklist_Master.[1] From TPL_Checklist_Master

However, when I try to do this on an ASP Page, it always causes an
error. I'm assuming this is because of the [] around the field name 1.
(I would change the field names, but I don't have control over that).

I know when trying to use a * in the statement Where field LIKE 'A*' I
needed to replace the * with a %. I was wondering if something similar
had to be done in this case.
I hope my description is clear enought to follow. Thanks in advance
for any help.

Jul 19 '05 #3
Aaron,

For starters, try changing your select statement to "select * from
TPL_Checklist_Master" Does that work?
I'm a little confussed on what the [1] is, is there really a column named
"1" in the database.

You could also just try "Select [1] from TPL_Checklist_Master"
Hope this helps
Steve

"Aaron" <aa************@hotmail.com> wrote in message
news:16**************************@posting.google.c om...
Hey,
I have a (hopefully) simple question that has been giving me some
problems. I'm trying to use a simple Select statement to access some
data in an access database.
In access, the sql statement is as follows:

SELECT TPL_Checklist_Master.[1] From TPL_Checklist_Master

However, when I try to do this on an ASP Page, it always causes an
error. I'm assuming this is because of the [] around the field name 1.
(I would change the field names, but I don't have control over that).

I know when trying to use a * in the statement Where field LIKE 'A*' I
needed to replace the * with a %. I was wondering if something similar
had to be done in this case.
I hope my description is clear enought to follow. Thanks in advance
for any help.

Jul 19 '05 #4
Hey all,
Thanks for your help and I'm sorry for any confusion. A little more
background.
Yes, 1 is a column in the database. There are several columns that
simply have numbers for the name. Unfortunately, i have no control
over this aspect of the database. It is also an access database.
The error that I'm receiving is as follows:

Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are
in conflict with one another.

The reasoning for the brackets around the field name is that, when
writing the query in access, it seems that it does not like to simply
use a number as a field name, but if you put brackets around it, it
works fine (can someone explain the reasoning behind this to me?). The
problem is, that when I include the brackets in the SQL statement in
an ASP Page, I get the above error.
If anyone can shed some light on a solution I would very much
appreciate it.

Thanks for you time,
Aaron
"Steve Lutz" <sl***@comcast.net> wrote in message news:<ey**************@tk2msftngp13.phx.gbl>...
Aaron,

For starters, try changing your select statement to "select * from
TPL_Checklist_Master" Does that work?
I'm a little confussed on what the [1] is, is there really a column named
"1" in the database.

You could also just try "Select [1] from TPL_Checklist_Master"
Hope this helps
Steve

"Aaron" <aa************@hotmail.com> wrote in message
news:16**************************@posting.google.c om...
Hey,
I have a (hopefully) simple question that has been giving me some
problems. I'm trying to use a simple Select statement to access some
data in an access database.
In access, the sql statement is as follows:

SELECT TPL_Checklist_Master.[1] From TPL_Checklist_Master

However, when I try to do this on an ASP Page, it always causes an
error. I'm assuming this is because of the [] around the field name 1.
(I would change the field names, but I don't have control over that).

I know when trying to use a * in the statement Where field LIKE 'A*' I
needed to replace the * with a %. I was wondering if something similar
had to be done in this case.
I hope my description is clear enought to follow. Thanks in advance
for any help.

Jul 19 '05 #5
What kind of database?

Ray at work

"Aaron" <aa************@hotmail.com> wrote in message
news:16**************************@posting.google.c om...
Hey all,
Thanks for your help and I'm sorry for any confusion. A little more
background.
Yes, 1 is a column in the database. There are several columns that
simply have numbers for the name. Unfortunately, i have no control
over this aspect of the database. It is also an access database.
The error that I'm receiving is as follows:

Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are
in conflict with one another.

The reasoning for the brackets around the field name is that, when
writing the query in access, it seems that it does not like to simply
use a number as a field name, but if you put brackets around it, it
works fine (can someone explain the reasoning behind this to me?). The
problem is, that when I include the brackets in the SQL statement in
an ASP Page, I get the above error.
If anyone can shed some light on a solution I would very much
appreciate it.

Thanks for you time,
Aaron
"Steve Lutz" <sl***@comcast.net> wrote in message

news:<ey**************@tk2msftngp13.phx.gbl>...
Aaron,

For starters, try changing your select statement to "select * from
TPL_Checklist_Master" Does that work?
I'm a little confussed on what the [1] is, is there really a column named "1" in the database.

You could also just try "Select [1] from TPL_Checklist_Master"
Hope this helps
Steve

"Aaron" <aa************@hotmail.com> wrote in message
news:16**************************@posting.google.c om...
Hey,
I have a (hopefully) simple question that has been giving me some
problems. I'm trying to use a simple Select statement to access some
data in an access database.
In access, the sql statement is as follows:

SELECT TPL_Checklist_Master.[1] From TPL_Checklist_Master

However, when I try to do this on an ASP Page, it always causes an
error. I'm assuming this is because of the [] around the field name 1.
(I would change the field names, but I don't have control over that).

I know when trying to use a * in the statement Where field LIKE 'A*' I
needed to replace the * with a %. I was wondering if something similar
had to be done in this case.
I hope my description is clear enought to follow. Thanks in advance
for any help.

Jul 19 '05 #6
Nevermind....you can call me a dumb***.... got the name of the
connection variable wrong in the open statement, transposed 2
letters....I love wasting time on stupid mistakes....
Thanks again for your help
"Steve Lutz" <sl***@comcast.net> wrote in message news:<ey**************@tk2msftngp13.phx.gbl>...
Aaron,

For starters, try changing your select statement to "select * from
TPL_Checklist_Master" Does that work?
I'm a little confussed on what the [1] is, is there really a column named
"1" in the database.

You could also just try "Select [1] from TPL_Checklist_Master"
Hope this helps
Steve

"Aaron" <aa************@hotmail.com> wrote in message
news:16**************************@posting.google.c om...
Hey,
I have a (hopefully) simple question that has been giving me some
problems. I'm trying to use a simple Select statement to access some
data in an access database.
In access, the sql statement is as follows:

SELECT TPL_Checklist_Master.[1] From TPL_Checklist_Master

However, when I try to do this on an ASP Page, it always causes an
error. I'm assuming this is because of the [] around the field name 1.
(I would change the field names, but I don't have control over that).

I know when trying to use a * in the statement Where field LIKE 'A*' I
needed to replace the * with a %. I was wondering if something similar
had to be done in this case.
I hope my description is clear enought to follow. Thanks in advance
for any help.

Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Bart Nessux | last post by:
Should an if statement have a corresponding else statement? Or, is it OK to have an if statement by itself. For completeness, it seems the two should be together, but from experience I know that a...
9
by: Jaime Wyant | last post by:
I know I've seen this somewhere, but can't seem to google it. Is there a way to use an alternate statement separator, other than the default ';'? jw
1
by: Tom D | last post by:
I'm rewriting a database interface that our company currently has. Currently it's using the Pear::DB interface, but we found that that was introducing a bit too much overhead. I'm rewriting the...
39
by: slogging_away | last post by:
Hi - I'm running Python 2.4.2 (#67, Sep 28 2005, 12:41:11) on win32, and have a script that makes numerous checks on text files, (configuration files), so discrepancies can be reported. The script...
0
by: Fuzzyman | last post by:
Hello all, The following is a copy of a blog entry. It's asking a question about future statements and the built in compile function. I'd appreciate any pointers or comments about possible...
20
by: Neroku | last post by:
Hello, i would like to know what the serious definition of statements and expressions is: i know an expression are evaluated to a value, i.e: 1 == 2 5+7 foo( 1,2) and a statement is...
2
by: ojorus | last post by:
Hi! Some questions regarding the mysqli-extension (php5) 1) Prepared statements: If I understand things right, prepared statements will give better performance if you make several similar...
3
by: Dmitri | last post by:
Hello! I have a developer that is playing around with some SQL statements using VB.NET. He has a test table in a SQL 2000 database, and he has about 2000 generated INSERT statements. When the...
0
by: Gary Herron | last post by:
Ohad Frand wrote: There is no way you can consider 'elif', 'else', 'except', and 'from' statements. However, as someone pointed out, the kwlist from the keyword module is the closest thing we...
0
by: Ohad Frand | last post by:
Hi Thanks a lot for your reply I think the main uses for it is to study the language and to see that I didn't miss anything else or that something is changed from one version to another. The...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.