473,387 Members | 1,388 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,387 software developers and data experts.

connectivity through DSN

Hi
I have written few line codes but puzzling me lot giving
errors...
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "wedding"
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "select * from Group"
rs.open sql, Conn ' Gives error this statement
Set rs = Nothing
Conn.close
Set Conn = Nothing

Connection is established successfully and recordset is
also created without any problem
but when it executes rs.open line it gives me error
tht
"SYNTAX ERROR NEAR FROM CLAUSE"
I cant understand whats going on...
Please help me...
Thanx in advance...
David
Jul 19 '05 #1
1 1429
David wrote:
Hi
I have written few line codes but puzzling me lot giving
errors...
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "wedding"
Don't use a DSN. Use the native OLEDB provider for your database. See here
for an example: www.able-consulting.com/ado_conn.htm. Avoid the ODBC section
and find the examples for the OLEDB provider for whatever your database is
(and in the future, always tell us what database you are using when asking a
database-related question).
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "select * from Group"
rs.open sql, Conn ' Gives error this statement
Set rs = Nothing
Conn.close
Set Conn = Nothing

Connection is established successfully and recordset is
also created without any problem
but when it executes rs.open line it gives me error
tht
"SYNTAX ERROR NEAR FROM CLAUSE"
I cant understand whats going on...
Please help me...
Thanx in advance...
David


"Group" is a reserved word. It is a keyword in all SQL languages that I know
of (think "Group By"). It is a bad idea to use a reserved word for a column
or table name. I stronly recommend that you change the name of this table to
a non-reserved word (such as "Groups"). If you cannot change the name of the
table for some reason, then you will need to surround it with brackets []
when using it in a query: Select ... From [Group]. See here for a list of
reserved words: http://www.aspfaq.com/show.asp?id=2080

I also suggest you avoid using "select * " in production code. Always
explicitly list the fields you wish your query to retun, even if you wish it
to return all the fields in your table. This is simply good coding practice,
and can avoid performance problems.

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"
Jul 19 '05 #2

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

Similar topics

3
by: Alex | last post by:
I have developed a VB application that uses Oracle 8i database for backend. The database server is on the local network. From my development machine, the application connects (via ODBC) to the...
2
by: Axel Dachtler | last post by:
I am looking for detailed information about the topic "connectivity" in Oracle 9i including JDBC and CGI. Thank you
1
by: harish | last post by:
I am using java applications to connect to my MS SQL Server database. I am using ODBC for database connectivity. If i am running my java applications in a remote PC and try to connect to database...
2
by: pengfrank | last post by:
I have a 500-MB full installation CD for SQL Server 2000. All I need is to install "Client Connectivity" component (about 272K) on a bunch of workstations for users across the nation. How do I...
3
by: Omegamon | last post by:
This one should be an easy one for the community. What sort of PC client software do I need for connectivity to a DB2 database? It appears DB2 Connect is special for PC/Unix Connectivity to...
3
by: junaid | last post by:
Hi to all, Can it is possible to connect to the databse like postgre or mysql through a C programm? I know the basics of C and I have developed a small program which uses a file for the...
3
by: Niks | last post by:
Hi, I need to connect to SQL server Database using a System DSN. Can anyone tell me how to connect to SQL Server using DSN in ASP.NET (VB.Net). Using a Try Catch block. Does anyone know how to...
1
by: Darren McDowell via .NET 247 | last post by:
I have a situation, I was wondering if someone could help me. Wehave a .net web service, it runs several transactions in sqlserver 2000. We have several clients which connect to this webservice in...
1
by: lovkeshanand | last post by:
Dear All, I am using the oracle transparent gateway connectivity with sql server using tg4msql,as far as settings are concerned those were set and Connectivity is working Fine, and getting the...
1
by: ohs | last post by:
Apologies for cross posting but I can't figure where to post. Please feel free to move my message elsewhere (notify mat<at>oldhallsoftware<.>com) cheers I have an ASP.net app that mobile...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.