|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
SQL on local
Hi everebody
I have one question. How can I configure SQL Server for testing web applications localy? Please help me!! |
|
#2
|
||||
|
||||
|
You don't need to configure it in any special way, just make sure when you are connecting you are using the correct connectionstring and the user (login) is setup and has correct permissions on the database.
|
|
#3
|
||||
|
||||
|
This is my question exactly. I am unsure what settings I have screwed up though.
Here is the error I am getting: Error Type: Microsoft VBScript runtime (0x800A01A8) Object required: 'Provider=sqloledb;Da' /subscriptions/ProcessSub.asp, line 192 Line 192 is : dbSubs.execute(sql) Here is the ASP code for the connection: Code:
<%
' create an ADO database connection
set dbSubs = server.createobject("adodb.connection")
'dbSubs.Open "Driver = {SQL Server}; Server=(local); Database=Subscription;Uid=sa;Pwd=12511;"
'dbSubs="Provider=sqloledb;Data Source=localhost;Initial Catalog=Subscription;Integrated Security=SSPI;"
dbSubs="Provider=sqloledb;Data Source=localhost;Initial Catalog=Subscription;User Id=sa;Password=12511;"
'If any of our names have a single quote, we will need to doublt it for insert
chrFirstName = replace(chrFirstName, "'", "''")
chrLastName = replace(chrLastName, "'", "''")
chrAddress = replace(chrAddress, "'", "''")
chrCardName = replace(chrCardName, "'", "''")
chrCity = replace(chrCity, "'", "''")
' SQL insert statement to insert the subscription data into the database
sql = "insert into subscriptions(" & _
"chrFirstName, " & _
"chrLastName, " & _
"chrAddress, " & _
"chrCity, chrState, chrZipCode, chrPhone, chrEmail, chrCardName, " & _
"chrCardType, chrCardNumber, chrExpDate, intLength) Values ('" & _
chrFirstName & "', '" & chrLastName & "', '" & chrAddress & "', '" & _
chrCity & "', '" & chrState & "', '" & chrZipCode & "', '" & chrPhone & _
"', '" & chrEmail & "', '" & chrCardName & "', '" & chrCardType & "', '" & _
chrCardNumber & "', '" & chrExpDate & "', " & intLength & ")"
dbSubs.execute(sql)
'response.write(sql)
end if
%>
Notice I have tried several connection strings. I am unsure if the problem is with my connection strings or with my SQL settings. I have both windows and SQL Server authentication. I am using the trial download of SQL Server on my computer. I am using http://localhost/subscriptions/ in a browser to test my files. any other info you need? Thanks! Matt |
|
#4
|
||||
|
||||
|
try this
Code:
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=sqloledb;Data Source=(local);Initial Catalog=databaseName;User Id=username;Password=password;"
If Conn.State = 1 Then
Response.write("Connection is open")
Else
Response.write("Connection couldn't be opened")
End If
Conn.Close
Set Conn = Nothing
|
|
#5
|
||||
|
||||
|
Thanks so much.
It worked! Matt |
|
#6
|
|||
|
|||
|
Welcome
![]() It's my first post in here ![]() My problem seemed to be quite similar. But while rewriting the code (I'm writing it on a standalone pc with no internet acces at all) I found a mistake in my spelling. Dumb me... Thanks anyway ![]() |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > SQL on local |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|