Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_database_setup thread: SQL Server 2000 Connection string for Global.asa


Message #1 by stephen@v... on Thu, 29 Mar 2001 07:00:17
Hi,



I am using ASP and SQL 2000.



In the global.asa file i have the code shown in Fig 1.0.



However i get the following message when the user session timesout shown 

in Fig 1.1.



Does anyone know why it would give me an error message when i use the same 

connection string within the application (ie DSN=NatMod) and it works fine.



Thanks for any help on this.



- Stephen





Figure 1.0

-------------------------------------------------------------------

<SCRIPT LANGUAGE=VBScript RUNAT=Server>



Sub Session_OnEnd()

  Dim cmdDelete

  Dim objConn

  Dim str2

	Set cmdDelete = CreateObject("ADODB.Command")

	Set objConn = CreateObject("ADODB.Connection")



	objConn.Open "DSN=NatMod"

    str1 = "DROP TABLE Temp" & Session.SessionID & "PRS"



On Error Resume Next 

	With cmdDelete

	.ActiveConnection = objConn

	.CommandType = 1

	.CommandText = str1

	.Execute , , adExecuteNoRecords

	End With

	Set cmdDelete = Nothing

	objConn.Close

End Sub

</SCRIPT>

-------------------------------------------------------------------





Figure 1.1

-------------------------------------------------------------------

Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][ODBC SQL Server 

Driver][SQL Server]Login failed for user 'STEPHEN\IWAM_STEPHEN'.

-------------------------------------------------------------------






  Return to Index