homepage Welcome to WebmasterWorld Guest from 23.20.211.153
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / WebmasterWorld / New To Web Development
Forum Library, Charter, Moderators: brotherhood of lan & mack

New To Web Development Forum

    
Connecting Classic ASP to Sql Express
ajaysanhotra




msg:3866092
 8:08 am on Mar 9, 2009 (gmt 0)

Hi basically i am .net developer ,recently my PM told me to develop existing project in classic ASP and Sql Express,here is the problem because as far as i know you don't have sql express interface unless you are using .Net.

Can someone please help me to find way to create tables in Sql Express and connect it to classic ASP

 

mattur




msg:3866271
 2:09 pm on Mar 9, 2009 (gmt 0)

ASP uses ADO to connect to databases. You just need an OLEDB connection string to connect to Sql Express. Something like:

Provider=SQLOLEDB.1;Data Source=*yourserver*;Initial Catalog=*yourdatabasename*;User ID=*youruserid*;Password=*yourpassword*;

And use ADO like:

<%
Const DB_CNN = "Provider=SQLOLEDB.1;Data Source=*yourserver*;Initial Catalog=*yourdatabasename*;User ID=*youruserid*;Password=*yourpassword*;"
Dim cnn,rst,sql
sql = "SELECT * FROM MyTable;"
Set cnn = Server.CreateObject("ADODB.Connection")
cnn.Open DB_CNN
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open sql, cnn
'
'do stuff with recordset
'
'IMPORTANT: always clean up afterwards
rst.Close
Set rst = Nothing
cnn.Close
Set cnn = Nothing
%>

Download SQL Server Management Studio Express to create and manage your database and tables.

ajaysanhotra




msg:3866979
 6:33 am on Mar 10, 2009 (gmt 0)

thanx mattur for ur help.....i started working on it...

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / New To Web Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved