• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 367
  • Last Modified:

Get RSS from news - ASP and MSSQL

I have a RSS script that works fine with MsAccess and I need to change it to connect to MS SQL.

This is the connection code that works with Access:
<%
Dim id
Dim currentDate
Dim pubDate

Const TABLE_NAME   = "News"
Const COL_ID       = "News_ID"
Const COL_MODIFIED = "News_date"
Const COL_TITLE    = "News_name"
Const COL_SUBTITLE = "News_headline"
Const COL_CONTENTS = "News_content"

SetLocale("en-us")

id = Request.QueryString("News_ID")
if Not IsEmpty(id) And IsNumeric(id) then
      id = CInt(id)
else
      id = 0
end if

Set rs = Server.CreateObject("ADODB.RecordSet")
query = "SELECT * FROM " & TABLE_NAME
if id > 0 then
      query = query & " WHERE " & COL_ID & "=" & id
end if

rs.Open query, Session("ConnectionString")

%>

And this is the SQL connection string I want to connect to instead of the MsAccess:

MM_connCMS_STRING = "Provider=SQLOLEDB;Data Source=SERVER NAME;Initial Catalog=AAA;User ID=AAA;Password=BBB;persist security info=False;"
0
GDB08
Asked:
GDB08
  • 2
1 Solution
 
Anthony PerkinsCommented:
Looks good to me.  What is the problem?
0
 
GDB08Author Commented:
Thanks for the reply.
This code connects to MsAccess database.  I need help to change it so it connects to MS SQL database instead with the following connections string:
MM_connCMS_STRING = "Provider=SQLOLEDB;Data Source=SERVER NAME;Initial Catalog=AAA;User ID=AAA;Password=BBB;persist security info=False;"
0
 
GDB08Author Commented:
I solved it. Case closed.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now