Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: ADO Connections


Message #1 by "Locke, Darrell (FCS/SFC)" <Darrell.Locke@g...> on Wed, 20 Feb 2002 09:41:33 -0400
Hi, I had changed my connection to my database from this:





'Dim ConnectionToDatabase

'	Set ConnectionToDatabase=Server.CreateObject("ADODB.Connection")

'	ConnectionToDatabase.ConnectionTimeout = 60

'	ConnectionToDatabase.Open "Profile"





To this:





Dim ConnectionToDatabase

ConnectionToDatabase.Mode =adModeShareExclusive

ConnectionToDatabase.Open "Provider=Microsoft.Jet.OLEDB.4.0;"  & _

           "Data Source=c:..\database1\liguistic.mdb;" & _

           "User Id=admin;" & _

           "Password=;"



But now I am getting this error, can some help me debug this?



Error Type:

Microsoft VBScript runtime (0x800A01A8)

Object required: ''

/hrform/linguistic.asp, line 9 



This is line 9 ----> ConnectionToDatabase.Mode =adModeShareExclusive

Message #2 by "Meinken, Joe" <Joe.Meinken@q...> on Wed, 20 Feb 2002 07:44:46 -0600
What is the adModShareExclusive set to?



-----Original Message-----

From: Locke, Darrell (FCS/SFC) [mailto:Darrell.Locke@g...]

Sent: Wednesday, February 20, 2002 7:42 AM

To: ASP Databases

Subject: [asp_databases] ADO Connections





Hi, I had changed my connection to my database from this:





'Dim ConnectionToDatabase

'	Set ConnectionToDatabase=Server.CreateObject("ADODB.Connection")

'	ConnectionToDatabase.ConnectionTimeout = 60

'	ConnectionToDatabase.Open "Profile"





To this:





Dim ConnectionToDatabase

ConnectionToDatabase.Mode =adModeShareExclusive

ConnectionToDatabase.Open "Provider=Microsoft.Jet.OLEDB.4.0;"  & _

           "Data Source=c:..\database1\liguistic.mdb;" & _

           "User Id=admin;" & _

           "Password=;"



But now I am getting this error, can some help me debug this?



Error Type:

Microsoft VBScript runtime (0x800A01A8)

Object required: ''

/hrform/linguistic.asp, line 9 



This is line 9 ----> ConnectionToDatabase.Mode =adModeShareExclusive






$subst('Email.Unsub').

Message #3 by "Ken Schaefer" <ken@a...> on Thu, 21 Feb 2002 12:39:10 +1100
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

: But now I am getting this error, can some help me debug this?

: 

: Error Type:

: Microsoft VBScript runtime (0x800A01A8)

: Object required: ''

: /hrform/linguistic.asp, line 9 

: 

: This is line 9 ----> ConnectionToDatabase.Mode =adModeShareExclusive

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Let's work backwards:



You are attempting to set the .Mode Property of an object.

The "object" is "ConnectionToDatabase".

The code is complaining that the object doesn't exist.

The object is non-existant because you haven't instantiated it.

You instantiate an object by doing:



Set objVarName = Server.CreateObject("...")



eg:



Set objConn = Server.CreateObject("ADODB.Connection")



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From: "Locke, Darrell (FCS/SFC)" <Darrell.Locke@g...>

Subject: [asp_databases] ADO Connections





: 'Dim ConnectionToDatabase

: ' Set ConnectionToDatabase=Server.CreateObject("ADODB.Connection")

: ' ConnectionToDatabase.ConnectionTimeout = 60

: ' ConnectionToDatabase.Open "Profile"

: 

: To this:

: 

: 

: Dim ConnectionToDatabase

: ConnectionToDatabase.Mode =adModeShareExclusive

: ConnectionToDatabase.Open "Provider=Microsoft.Jet.OLEDB.4.0;"  & _

:            "Data Source=c:..\database1\liguistic.mdb;" & _

:            "User Id=admin;" & _

:            "Password=;"

: 

: But now I am getting this error, can some help me debug this?

: 

: Error Type:

: Microsoft VBScript runtime (0x800A01A8)

: Object required: ''

: /hrform/linguistic.asp, line 9 

: 

: This is line 9 ----> ConnectionToDatabase.Mode =adModeShareExclusive

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




  Return to Index