473,395 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Moving on to SQL Express

Hi!

Just had to convert a asp website I have from Acces to MS SQL Express.

Is this an OK way to connect to the database?
It works great, but I just wanted to know if this is the best way to do
it....
The code runs on the same surver as the sql express server.
AdoConnection = "Provider=SQLOLEDB.1; Data Source=xxx.xx.xxx.xxx;Initial
Catalog=DatabaseName;Persist Security Info=True;User ID=sa;Password=Pass"

ConnectString = AdoConnection
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnectString

sqlBruker = "SELECT Fornavn FROM Bruker"
Set rsBruker = Server.CreateObject("ADODB.Recordset")
rsBruker.Open sqlBruker, conn, 3, 3
Response.Write(rsBruker("Fornavn"))
rsBruker.close
set rsBruker=nothing

Best regards,
Christopher Brandsdal
May 12 '06 #1
3 3830
Close. Explicitly creating a recordset is an extra step that isn't
required. Check out:

http://www.aspfaq.com/show.asp?id=2424
http://www.aspfaq.com/show.asp?id=2191

Ray at work

"Christopher Brandsdal" <ch*********@valdres.no> wrote in message
news:uw**************@TK2MSFTNGP02.phx.gbl...
Hi!

Just had to convert a asp website I have from Acces to MS SQL Express.

Is this an OK way to connect to the database?
It works great, but I just wanted to know if this is the best way to do
it....
The code runs on the same surver as the sql express server.
AdoConnection = "Provider=SQLOLEDB.1; Data Source=xxx.xx.xxx.xxx;Initial
Catalog=DatabaseName;Persist Security Info=True;User ID=sa;Password=Pass"

ConnectString = AdoConnection
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnectString

sqlBruker = "SELECT Fornavn FROM Bruker"
Set rsBruker = Server.CreateObject("ADODB.Recordset")
rsBruker.Open sqlBruker, conn, 3, 3
Response.Write(rsBruker("Fornavn"))
rsBruker.close
set rsBruker=nothing

Best regards,
Christopher Brandsdal

May 12 '06 #2
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:uH**************@TK2MSFTNGP05.phx.gbl...
Close. Explicitly creating a recordset is an extra step that isn't
required. Check out:

http://www.aspfaq.com/show.asp?id=2424
http://www.aspfaq.com/show.asp?id=2191

Ray at work

"Christopher Brandsdal" <ch*********@valdres.no> wrote in message
news:uw**************@TK2MSFTNGP02.phx.gbl...
Hi!

Just had to convert a asp website I have from Acces to MS SQL Express.

Is this an OK way to connect to the database?
It works great, but I just wanted to know if this is the best way to do
it....
The code runs on the same surver as the sql express server.
AdoConnection = "Provider=SQLOLEDB.1; Data Source=xxx.xx.xxx.xxx;Initial
Catalog=DatabaseName;Persist Security Info=True;User ID=sa;Password=Pass"

Don't you think it is a touch dangerous connecting as System Administrator?

Create another user, assign appropriate permissions, use that instead.

--
John Blessing

http://www.LbeHelpdesk.com - Help Desk software priced to suit all
businesses
http://www.room-booking-software.com - Schedule rooms & equipment bookings
for your meeting/class over the web.
http://www.lbetoolbox.com - Remove Duplicates from MS Outlook, find/replace,
send newsletters
May 15 '06 #3
Thanks! Worked great :)
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> skrev i
melding news:uH**************@TK2MSFTNGP05.phx.gbl...
Close. Explicitly creating a recordset is an extra step that isn't
required. Check out:

http://www.aspfaq.com/show.asp?id=2424
http://www.aspfaq.com/show.asp?id=2191

Ray at work

"Christopher Brandsdal" <ch*********@valdres.no> wrote in message
news:uw**************@TK2MSFTNGP02.phx.gbl...
Hi!

Just had to convert a asp website I have from Acces to MS SQL Express.

Is this an OK way to connect to the database?
It works great, but I just wanted to know if this is the best way to do
it....
The code runs on the same surver as the sql express server.
AdoConnection = "Provider=SQLOLEDB.1; Data Source=xxx.xx.xxx.xxx;Initial
Catalog=DatabaseName;Persist Security Info=True;User ID=sa;Password=Pass"

ConnectString = AdoConnection
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnectString

sqlBruker = "SELECT Fornavn FROM Bruker"
Set rsBruker = Server.CreateObject("ADODB.Recordset")
rsBruker.Open sqlBruker, conn, 3, 3
Response.Write(rsBruker("Fornavn"))
rsBruker.close
set rsBruker=nothing

Best regards,
Christopher Brandsdal


May 31 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Alan | last post by:
I'm trying to find the time to move from Visual InterDev 6.0 to VS.Net for my VB/COM/ASP web development work - but I'm losing the battle. What are my chances of installing VS.Net and then using it...
18
by: steve.anon | last post by:
Hi I'm a Java developer moving to windows only applications. Of course the first thing I thought was "well at least, without the VM now I can write desktop applications that run real fast". So I...
6
by: Woody Splawn | last post by:
I have been using SQL Server 2000 on my stand-alone machine as a back-end to a VS.net application. It is time to switch environments and take the application to the customer. I need to install...
0
by: tom c | last post by:
I have three questions concerning moving to version 2.0: 1. I have some ASP.NET 1.1 projects that I may need to do maintenance on in the future, but I would like to do all new projects in ASP.NET...
3
by: Efi Merdler | last post by:
Hello, I developed my previous project (an MFC project with managed extensions) on VC.NET standard edition, it took some time to configure it but eventually it worked. Now I'm configuring a new...
7
by: white lightning | last post by:
Hi all, I need to learn asp.net in a quick and smart way. I am pretty good with PHP but I am an absolute newbie with .net. I am even not very familiar with Visual Basic and other windows...
4
by: =?Utf-8?B?R1Q=?= | last post by:
I have a Form which has a great number of events. I thought I would organize the project by moving some of the code into multiple '.cs' files (since the Form.cs was getting huge). When I move them,...
0
by: linkswanted | last post by:
World Moving & Storage Moving Companies and Movers We would like to take this opportunity to introduce "World Moving & Storage" to You. "World Moving & Storage" is well established, Fully...
15
by: mcjason | last post by:
I saw something interesting about a grid pair puzzle problem that it looks like a machine when you find each that work out the way it does and say with all the others that work out the way they...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.