Forums
This topic is locked
Problems with MS SQL server and ASP
Posted 02 Mar 2003 21:48:15
1
has voted
02 Mar 2003 21:48:15 Oliver Essame posted:
Hi Guys,I've just decided to upgrade our Access Database to SQL server and have started experiencing some strange problems.
Text fields now don't render on the web page even though the data can be seen in the RS within Dreamweaver MX. If I switch the ODBC DSN back to Access, the text renders.
Also simple ASP is failing to work such as:
<% If RS("Field"

render this code
<% Else %>
display default code
<% End If %>
It always renders the default code rather even if the value is greater than 0.
I was under the impression upsizing our web app from Access to SQL server would be reasonably easy, but obviously not.
If anyone can shed somelight, it would be much appreciated.
Regards,
Oliver
Replies
Replied 02 Mar 2003 22:40:44
02 Mar 2003 22:40:44 Owen Eastwick replied:
Not too sure about the first problem, however you might want to look at the data type of the fields in SQL Server, when you convert the data base SQL Server doesn't allways use the data type I would prefer e.g.
Text (100) in Access ==> VarChar (100) in SQL Server
Memo in Access ==> Text in SQL Server
Your second bit of code won't work if it is refering to field with a data type of Integer, should be:
<% If RS("Field"
<> 0 then %>
render this code
<% Else %>
display default code
<% End If %>
or perhaps:
<% If RS("Field"
<> NULL then %>
render this code
<% Else %>
display default code
<% End If %>
Regards
Owen.
-------------------------------------------------------------------------------------------
Used programming books and web development software for sale (UK only): www.tdsf.co.uk/tdsfdemo/Shop.htm
Developer services and tutorials: www.drdev.net
Multiple Parameter UD4 / Access 2000 Search Tutorial: www.tdsf.co.uk/tdsfdemo/
Text (100) in Access ==> VarChar (100) in SQL Server
Memo in Access ==> Text in SQL Server
Your second bit of code won't work if it is refering to field with a data type of Integer, should be:
<% If RS("Field"

render this code
<% Else %>
display default code
<% End If %>
or perhaps:
<% If RS("Field"

render this code
<% Else %>
display default code
<% End If %>
Regards
Owen.
-------------------------------------------------------------------------------------------
Used programming books and web development software for sale (UK only): www.tdsf.co.uk/tdsfdemo/Shop.htm
Developer services and tutorials: www.drdev.net
Multiple Parameter UD4 / Access 2000 Search Tutorial: www.tdsf.co.uk/tdsfdemo/