Author |
Topic |
|
merdok
Junior Member
United Kingdom
129 Posts |
Posted - 18 April 2002 : 17:51:31
|
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
|
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 |
|
|
merdok
Junior Member
United Kingdom
129 Posts |
Posted - 18 April 2002 : 18:45:17
|
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 |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 18 April 2002 : 19:29:14
|
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 |
|
|
merdok
Junior Member
United Kingdom
129 Posts |
Posted - 19 April 2002 : 08:38:44
|
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 |
|
|
TerryG
Junior Member
United Kingdom
179 Posts |
Posted - 19 April 2002 : 09:06:36
|
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.
|
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 19 April 2002 : 09:22:30
|
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 |
|
|
merdok
Junior Member
United Kingdom
129 Posts |
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
Bunce
New Member
Australia
84 Posts |
Posted - 20 April 2002 : 05:19:32
|
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! |
|
|
Romee
Junior Member
Netherlands
180 Posts |
Posted - 20 April 2002 : 07:45:28
|
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
|
|
|
|
Topic |
|