Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 HELP!!! UltraDEV DSN --> DSNLess Problems
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

merdok
Junior Member

United Kingdom
129 Posts

Posted - 18 April 2002 :  17:51:31  Show Profile  Visit merdok's Homepage  Send merdok an ICQ Message
I have made a site using DreamWeaver UD and it has used DSN connections... but my hosting uses DSNLess... is there an easy way to convert EVERYTHING that dreamweaver has made dsn into dsnless???

Please help guys... this is really driving me insane!

---------------------
Visit the entertainment system: http://www.filteredreality.co.uk

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 18 April 2002 :  18:12:02  Show Profile  Send ruirib a Yahoo! Message
A DSNless connection has one of two forms:

strConnString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("db/snitz_forums_2000.mdb") or

strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db/snitz_forums_2000.mdb")

I prefer the second, since OLEDB drivers are more robust and offer better performance than ODBC. Now it's just a matter of replacing your DSN connections by connections using this syntax. I don't see a big problem with that. Looks simple enough.

-------------------------------------------------
Installation Guide | Do's and Dont's | MODs
Go to Top of Page

merdok
Junior Member

United Kingdom
129 Posts

Posted - 18 April 2002 :  18:45:17  Show Profile  Visit merdok's Homepage  Send merdok an ICQ Message
Ah yeah, but then what do I do to get this working?

<%
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_products_STRING
Recordset1.Source = "SELECT * FROM user"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>

It appears that it doesnt like working without the ODBC.

---------------------
Visit the entertainment system: http://www.filteredreality.co.uk

Edited by - merdok on 18 April 2002 18:50:16
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 18 April 2002 :  19:29:14  Show Profile  Send ruirib a Yahoo! Message
What's the value of MM_products_STRING? Was it the value of the connection string like, "DSN=YourDSN"?

If so, this is what I'd suggest:

Use a declaration like this one and put in a separate file:

MM_products_STRING= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db/snitz_forums_2000.mdb")

Then include the previous file wherever you need to connect to the DB. Then use your code just as you were using it now.





-------------------------------------------------
Installation Guide | Do's and Dont's | MODs
Go to Top of Page

merdok
Junior Member

United Kingdom
129 Posts

Posted - 19 April 2002 :  08:38:44  Show Profile  Visit merdok's Homepage  Send merdok an ICQ Message
Well that APPEARS to have got that working but now I get a syntax error on line 10, which has this on it.

Recordset1.Open()

however the error is "Syntax error in FROM clause."

but there isnt a from clause anywhere near line 10.

I dont know enough about asp for this! :(

---------------------
Visit the entertainment system: http://www.filteredreality.co.uk
Go to Top of Page

TerryG
Junior Member

United Kingdom
179 Posts

Posted - 19 April 2002 :  09:06:36  Show Profile
In my (limited) experience, when you have a syntax error in the SQL statement the line number given is never that of the SQL statement itself, its always the line which tries to use the SQL statement ie Recordset1.Open() (unless your SQL statement is on the same line as the Recordset.Open() which yours apparently is not).

The problem is with your 'FROM' clause regardless of what line its actually on.

Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 19 April 2002 :  09:22:30  Show Profile  Send ruirib a Yahoo! Message
As Terry posted the problem is with the SQL instruction. Nothing to do with the ASP.

What SQL instruction are you trying to use?

-------------------------------------------------
Installation Guide | Do's and Dont's | MODs
Go to Top of Page

merdok
Junior Member

United Kingdom
129 Posts

Posted - 19 April 2002 :  10:11:00  Show Profile  Visit merdok's Homepage  Send merdok an ICQ Message
hmm... i'm not sure... here is the problem file...

http://filteredreality.co.uk/default.txt

any ideas?

---------------------
Visit the entertainment system: http://www.filteredreality.co.uk

Edited by - merdok on 19 April 2002 10:12:32
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 19 April 2002 :  10:44:42  Show Profile  Send ruirib a Yahoo! Message
Is there a table named user in the database?

-------------------------------------------------
Installation Guide | Do's and Dont's | MODs
Go to Top of Page

Bunce
New Member

Australia
84 Posts

Posted - 20 April 2002 :  05:19:32  Show Profile  Send Bunce an ICQ Message
USER is probably a reserved word. Rename your table.

Cheers,
Andrew

======================================================
There have been many, many forum posts made throughout the world...
This was one of them!
Go to Top of Page

Romee
Junior Member

Netherlands
180 Posts

Posted - 20 April 2002 :  07:45:28  Show Profile
merdok,
It probably works when you change the value of the first cursortype to 1 instead of 0

<%
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_products_STRING
Recordset1.Source = "SELECT * FROM user"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
Romée

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.23 seconds. Powered By: Snitz Forums 2000 Version 3.4.07