Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
|
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 23rd, 2004, 11:12 PM
Authorized User
 
Join Date: Apr 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Antony
Default SQL Server Beginner

Hi All,

Can you please guide me to convert my Access/ASP website to SQL Server/ASP, beginning from connecting to the database from ASP.

TIA

Antony
__________________
Antony
 
Old April 24th, 2004, 08:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

There are several things need to be looked into. It is not as simple as you say in a sentence. I can run you through some of them, that strikes my brain immediately.

Have you ported the data from Access to SQL?

1) You got to change you Connection string to connect to SQL Server based on the provider that you prefer. Standard connection string is

"Provider=sqloledb;Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;"

Still you can refer for other ways to connect to SQLServer at this URL - www.connectionstrings.com

2) Some places where date fields are used should be looked into.
    Access uses #DATEFIELD# format for date manipulation.
    SQLServer does not use that, just have to put them within quotes - '2004-04-23 00:00:00.000' or '2004-04-23'

Still more to be done, I dont actually remember everything, but I can assure you that you would get a lot of help here then and there.

Feel free to ask if any clarifications needed.

All the best.

-Vijay G
 
Old April 26th, 2004, 10:31 PM
Authorized User
 
Join Date: Apr 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Antony
Default

I could port the data using transformation option in SQL.

Now trying Connection strings.

Thank you vijay

Antony
 
Old April 26th, 2004, 11:31 PM
Authorized User
 
Join Date: Apr 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Antony
Default

Hi,

The connection string i used is,

Set conn=server.createobject("ADODB.connection")
Conn.open "Provider=sqloledb;Data Source=raghav;Initial Catalog=pubs;User Id=antony;Password=abcd;"

and it went through.

How to refer the table in SQL. What i did in access is,

set rs=server.createobject("ADODB.Recordset")
sql="select * from mytable where noActive=1 order by SortCode"
set rs=conn.Execute(sql)

when i used the same code after the connection string, it gave me,
Invalid object name 'mytable' error

I have given "select" permission to user antony in the server.

The question i have is, I have not referred the Database anywhere in the connectionstring or in the sql i supplied to conn.execute. and I suppose that this could be causing the error. please help.

TIA

Antony
 
Old April 29th, 2004, 01:35 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Give your database name in the connection string.

Conn.open "Provider=sqloledb;Data Source=raghav;Initial Catalog=YOUR_DATABASE_NAME;User Id=antony;Password=abcd;"

Currently it refers to PUBS databse.

-Vijay G





Similar Threads
Thread Thread Starter Forum Replies Last Post
Conflict in SQL Server 2000 and SQL Server 2005 ayan.mukherjee SQL Language 0 June 30th, 2008 03:34 AM
SQL Server Reg. SQL Server does not exist error Arsi SQL Server 2000 1 June 11th, 2008 11:20 AM
100% Beginner, Can't get SQL Express connected adamincambridge BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 5 December 17th, 2006 06:45 PM
Beginner SQL Programming Question monocles303 SQL Language 1 September 12th, 2006 03:47 AM
Beginner Problems(maybe server) stu9820 ASP.NET 1.0 and 1.1 Basics 2 August 21st, 2003 01:30 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.