Ask a Question related to ASP, Design and Development.

  1. #1

    Default Re: database connection

    What is being returned?

    An error raised by the DLL?
    If Err.Number <> 0 Then MsgBox "An error occurred in the DLL"
    [Nothing]?
    If con Is Nothing Then MsgBox "An error occurred in the DLL"
    ADODB.Connection but with invalid connection string?
    If TypeName(con) = "Connection" Then MsgBox "Returned a connection
    object"

    NB: Make sure you do *not* have On Error Resume Next in your ASP when you
    test.

    Chris.

    "Ajay" <ar_doc2@yahoo.co.in> wrote in message
    news:cdc73bc1.0307040357.77f80bee@posting.google.c om...
    > Hi
    >
    > I have made a dll in vb6.0 that returns a adodb.connection object
    > through a function call. The code for connection string uses DSN. Now
    > when i use this dll in vb6.0 project and call the function, it returns
    > the connection object to adodb.connection object in my project and the
    > connection is made.
    >
    > But when i use the same DLL in one of the forms of the asp project and
    > returns the connection object, then the connection is not made.
    >
    > The code in asp form is as follows:-
    >
    > set con = server.CreateObject("ADODB.connection")
    > set con1 = server.CreateObject("mydll.Connection1")
    > set con = con1.conn()
    >
    > Thanks for any suggestions

    Chris Barber Guest

  2. Similar Questions and Discussions

    1. connection database
      Hello every one, please some body to help me. How to store the data text in Access databases using flash form and to search into the database. It is...
    2. mx7 connection to sql database
      I cannot connect mx7 to sql server 2000 database...........the error I am getting is. Connection verification failed for data source: apl...
    3. Create Database Connection
      I'm trying, for the first time, to set up a MySQL database connection using Dreamweaver's Databases tab. Please note I can succesffully connect to...
    4. Database Connection ASP.NET Issue
      Using DW MX 2004 on windows XP SP2, IIS, using ASP.NET, VB for code, Access 2000 DB, I create a OLE DB database connection using the connection...
    5. connection to database
      Hi im using dreamweaver for the first time and im having problems displaying recordsets between the database and dreamweaver. I have defined the...
  3. #2

    Default Re: database connection

    Ajay wrote:
    > Hi
    >
    > I have made a dll in vb6.0 that returns a adodb.connection object
    > through a function call. The code for connection string uses DSN. Now
    > when i use this dll in vb6.0 project and call the function, it returns
    > the connection object to adodb.connection object in my project and the
    > connection is made.
    >
    > But when i use the same DLL in one of the forms of the asp project and
    > returns the connection object, then the connection is not made.
    >
    > The code in asp form is as follows:-
    >
    > set con = server.CreateObject("ADODB.connection")
    > set con1 = server.CreateObject("mydll.Connection1")
    > set con = con1.conn()
    >
    You've done too many steps here. One line is all that's needed:
    set con = server.CreateObject("mydll.Connection1")

    Now, what do you mean by "the connection is not made"? Error message?

    Without details, we can only guess, so:

    How have you declared your vb function that returns the connection? Like
    this?
    Public Function GetConnection AS ADODB.Connection

    If so, this will fail. The vb dll has to return a variant to vbs. Remember,
    the only datatype in vbs is the variant.

    Bob Barrows



    Bob Barrows Guest

  4. #3

    Default DataBase connection

    hello friends,

    i am developing an asp.net application in which
    i want to keep database connection of
    my application alive through out the application.

    in my case, my DBMS is MS SQL Server 2000.

    i came to know that in application_init event of
    the application, we can put some code to
    connect to our back-end.

    i tried to search a lot for this event in
    developer environment but could not locate it.

    so can anyone tell where do i need to put the code ?

    thank you.

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    varun varun Guest

  5. #4

    Default Re: DataBase connection

    You need to dump the idea. ADO.Net is designed to leverage Connection
    Pooling, and trying to use one Connection for the entire app is not a good
    or safe idea.

    HTH,

    Kevin Spencer
    Microsoft FrontPage MVP
    Internet Developer
    [url]http://www.takempis.com[/url]
    Some things just happen.
    Everything else occurs.

    "varun varun" <anonymous@devdex.com> wrote in message
    news:ez4Hd2HRDHA.3192@tk2msftngp13.phx.gbl...
    > hello friends,
    >
    > i am developing an asp.net application in which
    > i want to keep database connection of
    > my application alive through out the application.
    >
    > in my case, my DBMS is MS SQL Server 2000.
    >
    > i came to know that in application_init event of
    > the application, we can put some code to
    > connect to our back-end.
    >
    > i tried to search a lot for this event in
    > developer environment but could not locate it.
    >
    > so can anyone tell where do i need to put the code ?
    >
    > thank you.
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Kevin Spencer Guest

  6. #5

    Default Re: database connection

    The following code in my ASP page (running as IUSR account):

    Dim pobjConnection
    Dim RSF
    Set RSF = Server.CreateObject("RSAccess140.RSFunctionsADODB" )
    Set pobjConnection = Server.CreateObject("ADODB.Connection")

    Set pobjConnection = RSF.GetSQLConnection("ASIMOV", "IISLOGS", "sa",
    "hieroglyphs", 20)

    Response.Write "Connection State = " & pobjConnection.State

    Set pobjConnection = Nothing
    Set RSF = Nothing

    Shows:

    Connection State = 1

    I've never had a problem with the RSAccess DLL object so far in three years.

    You can peruse the DLL VB project at:

    [url]http://ftp.belper.blue-canoe.net/RSAccess/RSAccess.zip[/url]

    The definition of my public function is:

    Public Function GetSQLConnection(ByVal strSQLServerName As String, ByVal
    strSQLServerInitialCatalog As String, Optional ByVal strSQLUserID As String,
    Optional ByVal strSQLPwd As String, Optional ByVal plngTimeoutSeconds As
    Long) As ADODB.Connection

    .... implementation ...

    End Function

    So ... are you sure that your connection string is valid and that the IIS
    user context has permissions to access the data source?

    BTW: If you can actually see that the connection state is 0 then you *have*
    returned an ADODB.Connection object - albeit one where the connection could
    not be established!

    Chris.


    Chris.



    "Ajay" <ar_doc2@yahoo.co.in> wrote in message
    news:cdc73bc1.0307092242.907f7e4@posting.google.co m...
    > "Chris Barber" <chris@blue-canoe.co.uk.NOSPAM> wrote in message
    news:<ez$hXqiQDHA.3796@tk2msftngp13.phx.gbl>...
    > > That's not 100% correct. You can return early bound object references
    (such
    > > as ADODB.Connection) but you can't pass them in as parameters of
    function
    > > calls and subs.
    > >
    > > eg.
    > >
    > > [All ASP to DLL calls]
    > >
    > > This works:
    > >
    > > Public Function GetConnection() as ADODB.Connection
    > > End Function
    > >
    > > This doesn't (can't be called from script) because script (late bound)
    can't
    > > pass the recordset as an 'ADODB.Recordset' it can only pass it as a
    > > 'Variant' thus it cannot satisfy the DLLs request for an early bound
    object
    > > reference for the recordset parameter.
    > >
    >
    > Hi
    >
    > I have written the following function in the dll
    >
    > Public Function conn() As ADODB.Connection
    > Dim con As New ADODB.Connection
    > con.Open "Provider=MSDAORA;Data
    > Source=test;UserID=test1;Password=test1;Persist Security Info=True"
    > Set conn = con
    > End Function
    >
    > The Problem is that when i call the function through asp page then it
    > does not return the connection object and enters the if structure i.e
    > con.state=0
    > But when i write the single line of con.open directly into the asp
    > page the connection is made.
    >
    > Because i am maintaining the existing code therefore i want that the
    > dll function should return the connection object. How the dll function
    > should be written so that following code on the asp page works.
    >
    > set con = server.CreateObject("ADODB.connection")
    > set con1 = server.CreateObject("mydll.clsConnect")
    > set con = con1.conn()
    >
    > Thanks
    > Ajay
    >
    >
    >
    >
    >
    >
    > > Public Function DoSomething(ByRef pobjRS as ADODB.Recordset) as
    > > ADODB.Recordset
    > > End Function
    > >
    > > This works:
    > >
    > > Public Function DoSomething(ByRef pobjRS as Variant) as
    ADODB.Recordset
    > > If TypeOf pobjRS Is ADODB.Connection Then
    > > 'Do the work cos the passed in object is correct.
    > > End If
    > > End Function
    > >
    > > Chris.
    > >
    > > "Bob Barrows" <reb_01501@yahoo.com> wrote in message
    > > news:eJck9iiQDHA.2312@TK2MSFTNGP12.phx.gbl...
    > > > Ajay wrote:
    > > > > Hi
    > > > >
    > > > > I have made a dll in vb6.0 that returns a adodb.connection object
    > > > > through a function call. The code for connection string uses DSN.
    Now
    > > > > when i use this dll in vb6.0 project and call the function, it
    returns
    > > > > the connection object to adodb.connection object in my project and
    the
    > > > > connection is made.
    > > > >
    > > > > But when i use the same DLL in one of the forms of the asp project
    and
    > > > > returns the connection object, then the connection is not made.
    > > > >
    > > > > The code in asp form is as follows:-
    > > > >
    > > > > set con = server.CreateObject("ADODB.connection")
    > > > > set con1 = server.CreateObject("mydll.Connection1")
    > > > > set con = con1.conn()
    > > > >
    > > > You've done too many steps here. One line is all that's needed:
    > > > set con = server.CreateObject("mydll.Connection1")
    > > >
    > > > Now, what do you mean by "the connection is not made"? Error message?
    > > >
    > > > Without details, we can only guess, so:
    > > >
    > > > How have you declared your vb function that returns the connection?
    Like
    > > > this?
    > > > Public Function GetConnection AS ADODB.Connection
    > > >
    > > > If so, this will fail. The vb dll has to return a variant to vbs.
    > > Remember,
    > > > the only datatype in vbs is the variant.
    > > >
    > > > Bob Barrows
    > > >
    > > >
    > > >

    Chris Barber Guest

  7. #6

    Default Re: database connection

    Good job thats an internal SQL database then if I'm going to plaster the sa
    password about all over the place - suffice to say it's changed already.

    Doh!

    Chris.

    "Chris Barber" <chris@blue-canoe.co.uk.NOSPAM> wrote in message
    news:%23cAGQHrRDHA.2148@TK2MSFTNGP10.phx.gbl...
    > The following code in my ASP page (running as IUSR account):
    >
    > Dim pobjConnection
    > Dim RSF
    > Set RSF = Server.CreateObject("RSAccess140.RSFunctionsADODB" )
    > Set pobjConnection = Server.CreateObject("ADODB.Connection")
    >
    > Set pobjConnection = RSF.GetSQLConnection("ASIMOV", "IISLOGS", "sa",
    > "hieroglyphs", 20)
    >
    > Response.Write "Connection State = " & pobjConnection.State
    >
    > Set pobjConnection = Nothing
    > Set RSF = Nothing
    >
    > Shows:
    >
    > Connection State = 1
    >
    > I've never had a problem with the RSAccess DLL object so far in three
    years.
    >
    > You can peruse the DLL VB project at:
    >
    > [url]http://ftp.belper.blue-canoe.net/RSAccess/RSAccess.zip[/url]
    >
    > The definition of my public function is:
    >
    > Public Function GetSQLConnection(ByVal strSQLServerName As String, ByVal
    > strSQLServerInitialCatalog As String, Optional ByVal strSQLUserID As
    String,
    > Optional ByVal strSQLPwd As String, Optional ByVal plngTimeoutSeconds As
    > Long) As ADODB.Connection
    >
    > ... implementation ...
    >
    > End Function
    >
    > So ... are you sure that your connection string is valid and that the IIS
    > user context has permissions to access the data source?
    >
    > BTW: If you can actually see that the connection state is 0 then you
    *have*
    > returned an ADODB.Connection object - albeit one where the connection
    could
    > not be established!
    >
    > Chris.
    >
    >
    > Chris.
    >
    >
    >
    > "Ajay" <ar_doc2@yahoo.co.in> wrote in message
    > news:cdc73bc1.0307092242.907f7e4@posting.google.co m...
    > > "Chris Barber" <chris@blue-canoe.co.uk.NOSPAM> wrote in message
    > news:<ez$hXqiQDHA.3796@tk2msftngp13.phx.gbl>...
    > > > That's not 100% correct. You can return early bound object references
    > (such
    > > > as ADODB.Connection) but you can't pass them in as parameters of
    > function
    > > > calls and subs.
    > > >
    > > > eg.
    > > >
    > > > [All ASP to DLL calls]
    > > >
    > > > This works:
    > > >
    > > > Public Function GetConnection() as ADODB.Connection
    > > > End Function
    > > >
    > > > This doesn't (can't be called from script) because script (late bound)
    > can't
    > > > pass the recordset as an 'ADODB.Recordset' it can only pass it as a
    > > > 'Variant' thus it cannot satisfy the DLLs request for an early bound
    > object
    > > > reference for the recordset parameter.
    > > >
    > >
    > > Hi
    > >
    > > I have written the following function in the dll
    > >
    > > Public Function conn() As ADODB.Connection
    > > Dim con As New ADODB.Connection
    > > con.Open "Provider=MSDAORA;Data
    > > Source=test;UserID=test1;Password=test1;Persist Security Info=True"
    > > Set conn = con
    > > End Function
    > >
    > > The Problem is that when i call the function through asp page then it
    > > does not return the connection object and enters the if structure i.e
    > > con.state=0
    > > But when i write the single line of con.open directly into the asp
    > > page the connection is made.
    > >
    > > Because i am maintaining the existing code therefore i want that the
    > > dll function should return the connection object. How the dll function
    > > should be written so that following code on the asp page works.
    > >
    > > set con = server.CreateObject("ADODB.connection")
    > > set con1 = server.CreateObject("mydll.clsConnect")
    > > set con = con1.conn()
    > >
    > > Thanks
    > > Ajay
    > >
    > >
    > >
    > >
    > >
    > >
    > > > Public Function DoSomething(ByRef pobjRS as ADODB.Recordset) as
    > > > ADODB.Recordset
    > > > End Function
    > > >
    > > > This works:
    > > >
    > > > Public Function DoSomething(ByRef pobjRS as Variant) as
    > ADODB.Recordset
    > > > If TypeOf pobjRS Is ADODB.Connection Then
    > > > 'Do the work cos the passed in object is correct.
    > > > End If
    > > > End Function
    > > >
    > > > Chris.
    > > >
    > > > "Bob Barrows" <reb_01501@yahoo.com> wrote in message
    > > > news:eJck9iiQDHA.2312@TK2MSFTNGP12.phx.gbl...
    > > > > Ajay wrote:
    > > > > > Hi
    > > > > >
    > > > > > I have made a dll in vb6.0 that returns a adodb.connection object
    > > > > > through a function call. The code for connection string uses DSN.
    > Now
    > > > > > when i use this dll in vb6.0 project and call the function, it
    > returns
    > > > > > the connection object to adodb.connection object in my project and
    > the
    > > > > > connection is made.
    > > > > >
    > > > > > But when i use the same DLL in one of the forms of the asp project
    > and
    > > > > > returns the connection object, then the connection is not made.
    > > > > >
    > > > > > The code in asp form is as follows:-
    > > > > >
    > > > > > set con = server.CreateObject("ADODB.connection")
    > > > > > set con1 = server.CreateObject("mydll.Connection1")
    > > > > > set con = con1.conn()
    > > > > >
    > > > > You've done too many steps here. One line is all that's needed:
    > > > > set con = server.CreateObject("mydll.Connection1")
    > > > >
    > > > > Now, what do you mean by "the connection is not made"? Error
    message?
    > > > >
    > > > > Without details, we can only guess, so:
    > > > >
    > > > > How have you declared your vb function that returns the connection?
    > Like
    > > > > this?
    > > > > Public Function GetConnection AS ADODB.Connection
    > > > >
    > > > > If so, this will fail. The vb dll has to return a variant to vbs.
    > > > Remember,
    > > > > the only datatype in vbs is the variant.
    > > > >
    > > > > Bob Barrows
    > > > >
    > > > >
    > > > >
    >
    >

    Chris Barber Guest

  8. #7

    Default Re: database connection

    Hi Chris,

    Thanks a lot. It did worked after all.

    Your rsaccess.zip file was trully helpful.

    Ajay.


    "Chris Barber" <chris@blue-canoe.co.uk.NOSPAM> wrote in message news:<#8GYMJrRDHA.2228@tk2msftngp13.phx.gbl>...
    > Good job thats an internal SQL database then if I'm going to plaster the sa
    > password about all over the place - suffice to say it's changed already.
    >
    > Doh!
    >
    > Chris.
    >
    > "Chris Barber" <chris@blue-canoe.co.uk.NOSPAM> wrote in message
    > news:%23cAGQHrRDHA.2148@TK2MSFTNGP10.phx.gbl...
    > > The following code in my ASP page (running as IUSR account):
    > >
    > > Dim pobjConnection
    > > Dim RSF
    > > Set RSF = Server.CreateObject("RSAccess140.RSFunctionsADODB" )
    > > Set pobjConnection = Server.CreateObject("ADODB.Connection")
    > >
    > > Set pobjConnection = RSF.GetSQLConnection("ASIMOV", "IISLOGS", "sa",
    > > "hieroglyphs", 20)
    > >
    > > Response.Write "Connection State = " & pobjConnection.State
    > >
    > > Set pobjConnection = Nothing
    > > Set RSF = Nothing
    > >
    > > Shows:
    > >
    > > Connection State = 1
    > >
    > > I've never had a problem with the RSAccess DLL object so far in three
    > years.
    > >
    > > You can peruse the DLL VB project at:
    > >
    > > [url]http://ftp.belper.blue-canoe.net/RSAccess/RSAccess.zip[/url]
    > >
    > > The definition of my public function is:
    > >
    > > Public Function GetSQLConnection(ByVal strSQLServerName As String, ByVal
    > > strSQLServerInitialCatalog As String, Optional ByVal strSQLUserID As
    > String,
    > > Optional ByVal strSQLPwd As String, Optional ByVal plngTimeoutSeconds As
    > > Long) As ADODB.Connection
    > >
    > > ... implementation ...
    > >
    > > End Function
    > >
    > > So ... are you sure that your connection string is valid and that the IIS
    > > user context has permissions to access the data source?
    > >
    > > BTW: If you can actually see that the connection state is 0 then you
    > *have*
    > > returned an ADODB.Connection object - albeit one where the connection
    > could
    > > not be established!
    > >
    > > Chris.
    > >
    > >
    > > Chris.
    > >
    > >
    > >
    > > "Ajay" <ar_doc2@yahoo.co.in> wrote in message
    > > news:cdc73bc1.0307092242.907f7e4@posting.google.co m...
    > > > "Chris Barber" <chris@blue-canoe.co.uk.NOSPAM> wrote in message
    > news:<ez$hXqiQDHA.3796@tk2msftngp13.phx.gbl>...
    > > > > That's not 100% correct. You can return early bound object references
    > (such
    > > > > as ADODB.Connection) but you can't pass them in as parameters of
    > function
    > > > > calls and subs.
    > > > >
    > > > > eg.
    > > > >
    > > > > [All ASP to DLL calls]
    > > > >
    > > > > This works:
    > > > >
    > > > > Public Function GetConnection() as ADODB.Connection
    > > > > End Function
    > > > >
    > > > > This doesn't (can't be called from script) because script (late bound)
    > can't
    > > > > pass the recordset as an 'ADODB.Recordset' it can only pass it as a
    > > > > 'Variant' thus it cannot satisfy the DLLs request for an early bound
    > object
    > > > > reference for the recordset parameter.
    > > > >
    > > >
    > > > Hi
    > > >
    > > > I have written the following function in the dll
    > > >
    > > > Public Function conn() As ADODB.Connection
    > > > Dim con As New ADODB.Connection
    > > > con.Open "Provider=MSDAORA;Data
    > > > Source=test;UserID=test1;Password=test1;Persist Security Info=True"
    > > > Set conn = con
    > > > End Function
    > > >
    > > > The Problem is that when i call the function through asp page then it
    > > > does not return the connection object and enters the if structure i.e
    > > > con.state=0
    > > > But when i write the single line of con.open directly into the asp
    > > > page the connection is made.
    > > >
    > > > Because i am maintaining the existing code therefore i want that the
    > > > dll function should return the connection object. How the dll function
    > > > should be written so that following code on the asp page works.
    > > >
    > > > set con = server.CreateObject("ADODB.connection")
    > > > set con1 = server.CreateObject("mydll.clsConnect")
    > > > set con = con1.conn()
    > > >
    > > > Thanks
    > > > Ajay
    > > >
    > > >
    > > >
    > > >
    > > >
    > > >
    > > > > Public Function DoSomething(ByRef pobjRS as ADODB.Recordset) as
    > > > > ADODB.Recordset
    > > > > End Function
    > > > >
    > > > > This works:
    > > > >
    > > > > Public Function DoSomething(ByRef pobjRS as Variant) as
    > ADODB.Recordset
    > > > > If TypeOf pobjRS Is ADODB.Connection Then
    > > > > 'Do the work cos the passed in object is correct.
    > > > > End If
    > > > > End Function
    > > > >
    > > > > Chris.
    > > > >
    > > > > "Bob Barrows" <reb_01501@yahoo.com> wrote in message
    > > > > news:eJck9iiQDHA.2312@TK2MSFTNGP12.phx.gbl...
    > > > > > Ajay wrote:
    > > > > > > Hi
    > > > > > >
    > > > > > > I have made a dll in vb6.0 that returns a adodb.connection object
    > > > > > > through a function call. The code for connection string uses DSN.
    > Now
    > > > > > > when i use this dll in vb6.0 project and call the function, it
    > returns
    > > > > > > the connection object to adodb.connection object in my project and
    > the
    > > > > > > connection is made.
    > > > > > >
    > > > > > > But when i use the same DLL in one of the forms of the asp project
    > and
    > > > > > > returns the connection object, then the connection is not made.
    > > > > > >
    > > > > > > The code in asp form is as follows:-
    > > > > > >
    > > > > > > set con = server.CreateObject("ADODB.connection")
    > > > > > > set con1 = server.CreateObject("mydll.Connection1")
    > > > > > > set con = con1.conn()
    > > > > > >
    > > > > > You've done too many steps here. One line is all that's needed:
    > > > > > set con = server.CreateObject("mydll.Connection1")
    > > > > >
    > > > > > Now, what do you mean by "the connection is not made"? Error
    > message?
    > > > > >
    > > > > > Without details, we can only guess, so:
    > > > > >
    > > > > > How have you declared your vb function that returns the connection?
    > Like
    > > > > > this?
    > > > > > Public Function GetConnection AS ADODB.Connection
    > > > > >
    > > > > > If so, this will fail. The vb dll has to return a variant to vbs.
    > Remember,
    > > > > > the only datatype in vbs is the variant.
    > > > > >
    > > > > > Bob Barrows
    > > > > >
    > > > > >
    > > > > >
    > >
    > >
    Ajay Guest

  9. #8

    Default Re: database connection

    Cool - I'm glad it worked for you - I'm very proud of it and its stood me in
    good stead for a couple of years now!

    Regards.

    Chris.

    "Ajay" <ar_doc2@yahoo.co.in> wrote in message
    news:cdc73bc1.0307161932.43108c27@posting.google.c om...
    > Hi Chris,
    >
    > Thanks a lot. It did worked after all.
    >
    > Your rsaccess.zip file was trully helpful.
    >
    > Ajay.
    >
    >
    > "Chris Barber" <chris@blue-canoe.co.uk.NOSPAM> wrote in message
    news:<#8GYMJrRDHA.2228@tk2msftngp13.phx.gbl>...
    > > Good job thats an internal SQL database then if I'm going to plaster the
    sa
    > > password about all over the place - suffice to say it's changed already.
    > >
    > > Doh!
    > >
    > > Chris.
    > >
    > > "Chris Barber" <chris@blue-canoe.co.uk.NOSPAM> wrote in message
    > > news:%23cAGQHrRDHA.2148@TK2MSFTNGP10.phx.gbl...
    > > > The following code in my ASP page (running as IUSR account):
    > > >
    > > > Dim pobjConnection
    > > > Dim RSF
    > > > Set RSF = Server.CreateObject("RSAccess140.RSFunctionsADODB" )
    > > > Set pobjConnection = Server.CreateObject("ADODB.Connection")
    > > >
    > > > Set pobjConnection = RSF.GetSQLConnection("ASIMOV", "IISLOGS", "sa",
    > > > "hieroglyphs", 20)
    > > >
    > > > Response.Write "Connection State = " & pobjConnection.State
    > > >
    > > > Set pobjConnection = Nothing
    > > > Set RSF = Nothing
    > > >
    > > > Shows:
    > > >
    > > > Connection State = 1
    > > >
    > > > I've never had a problem with the RSAccess DLL object so far in three
    > > years.
    > > >
    > > > You can peruse the DLL VB project at:
    > > >
    > > > [url]http://ftp.belper.blue-canoe.net/RSAccess/RSAccess.zip[/url]
    > > >
    > > > The definition of my public function is:
    > > >
    > > > Public Function GetSQLConnection(ByVal strSQLServerName As String,
    ByVal
    > > > strSQLServerInitialCatalog As String, Optional ByVal strSQLUserID As
    > > String,
    > > > Optional ByVal strSQLPwd As String, Optional ByVal plngTimeoutSeconds
    As
    > > > Long) As ADODB.Connection
    > > >
    > > > ... implementation ...
    > > >
    > > > End Function
    > > >
    > > > So ... are you sure that your connection string is valid and that the
    IIS
    > > > user context has permissions to access the data source?
    > > >
    > > > BTW: If you can actually see that the connection state is 0 then you
    > > *have*
    > > > returned an ADODB.Connection object - albeit one where the connection
    > > could
    > > > not be established!
    > > >
    > > > Chris.
    > > >
    [snip]


    Chris Barber Guest

  10. #9

    Default Database Connection

    Is there any way to connect to a Foxpro database to display results in
    asp.net (c#) application.
    Any sample code would be nice.

    Reddy


    Reddy Guest

  11. #10

    Default Database Connection

    Hi

    Here is the connection string to connect to foxpro
    database:

    OLE DB, OleDbConnection (.NET) standard:
    "Provider=Microsoft.Jet.OLEDB.4.0;Data
    Source=c:\folder;Extended Properties=dBASE IV;User
    ID=Admin;Password="

    HTH
    Ravikanth[MVP]


    >-----Original Message-----
    >Is there any way to connect to a Foxpro database to
    display results in
    >asp.net (c#) application.
    >Any sample code would be nice.
    >
    >Reddy
    >
    >
    >.
    >
    Ravikanth[MVP] Guest

  12. #11

    Default Re: Database Connection

    Sorry I have some more queries regarding this.

    If the Foxpro database is on a different computer and asp.net application is
    on a different computer on different networks then how to connect to the
    foxpro database.
    e.g: Foxpro computer is on computer with IP 195.100.100.50 and asp.net
    application is on a computer with IP 195.100.100.51

    Thanks,

    Reddy



    "Ravikanth[MVP]" <dvravikanth@hotmail.com> wrote in message
    news:09d101c35cd5$f8cba170$a501280a@phx.gbl...
    > Hi
    >
    > Here is the connection string to connect to foxpro
    > database:
    >
    > OLE DB, OleDbConnection (.NET) standard:
    > "Provider=Microsoft.Jet.OLEDB.4.0;Data
    > Source=c:\folder;Extended Properties=dBASE IV;User
    > ID=Admin;Password="
    >
    > HTH
    > Ravikanth[MVP]
    >
    >
    >
    > >-----Original Message-----
    > >Is there any way to connect to a Foxpro database to
    > display results in
    > >asp.net (c#) application.
    > >Any sample code would be nice.
    > >
    > >Reddy
    > >
    > >
    > >.
    > >

    Reddy Guest

  13. #12

    Default database connection

    When I want to connect to my access database I do this :
    set adoCon = server.CreateObject ("adodb.connection")
    adoCon.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
    Server.MapPath("******.mdb") & ";Persist Security Info=False"

    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open sqlstring, adoCon

    This works fine, I do have one question though. If I have the access file
    opend to for instance to add a record or something, if someone then try to
    access the database through asp the user get's a white error page with the
    text
    "Error Type:
    Microsoft JET Database Engine (0x80004005)
    Could not use ''; file already in use.
    /d042004/news.asp, line 55"

    Is there a way that I still show my html page just without the asp stuff,
    maybe add my own error message "Database down due to maintence. Please try
    again" or something.






    John Doe Guest

  14. #13

    Default Re: database connection

    John Doe wrote:
    > When I want to connect to my access database I do this :
    > set adoCon = server.CreateObject ("adodb.connection")
    > adoCon.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
    > Server.MapPath("******.mdb") & ";Persist Security Info=False"
    >
    > Set rs = Server.CreateObject("ADODB.Recordset")
    > rs.Open sqlstring, adoCon
    >
    > This works fine, I do have one question though. If I have the access
    > file opend to for instance to add a record or something, if someone
    > then try to access the database through asp the user get's a white
    > error page with the text
    > "Error Type:
    > Microsoft JET Database Engine (0x80004005)
    > Could not use ''; file already in use.
    > /d042004/news.asp, line 55"
    >
    > Is there a way that I still show my html page just without the asp
    > stuff, maybe add my own error message "Database down due to
    > maintence. Please try again" or something.
    See this message:
    [url]http://tinyurl.com/oy5q[/url]
    And these articles:
    [url]http://www.aspfaq.com/show.asp?id=2062[/url] - updatable cursor
    [url]http://www.aspfaq.com/show.asp?id=2009[/url] - 80004005 errors

    HTH,
    Bob Barrows




    Bob Barrows Guest

  15. #14

    Default database connection

    I'm having trouble diagnosing a SQL Connection issue from
    an ASP page.
    Error Message: [Microsoft][ODBC SQL Server Driver][Named
    Pipes} SQL Server does not exist or access denied.
    Environment: Windows 2000 SP4, IIS, SQL 2000 SP3. SQL is
    configured for Windows & SQL Authentication. In the Client
    Connection Utility the enabled protocols are: Named Pipes
    & TCP/IP; the order of their appearance does not impact
    the issue.

    I know this is the standard SQL connection error message &
    have researched the probable causes, none seem to apply.
    The Intranet site has a GLOBAL.ASA with an Application
    ("ConnectionString") = "Provider=MSDASQL;driver={SQL
    Server}; Server=xxxxxxxx; Database= dbname; UID=userID;
    PWD=password; DSN=' '". When the ASP pages need to connect
    to the database they use this global connection parameter:
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.open Application("ConnectionString")
    Sql = "SELECT *.."
    Set RS = Conn.Execute(SQL)
    IF RS.EOF then
    ....
    What is confusing about this case is that we have a fat
    client application that also accesses the same database;
    once it connects to the database the ASP pages connect &
    work fine. Also, the same applications are installed on
    other servers that are not having this problem (the other
    servers have the same operating environment). The
    connection properties for both applications use a SQL user
    account; the ISUR_machinename account is not used for
    database access.

    There is another issue with this server that I suspect may
    be related. This is a multi-homed server, where the other
    servers are not. When we boot the system we are unable to
    connect to other servers or the Internet. If we disable
    one of the NICs, we can connect to the other locations. We
    can then enable the NIC previously disabled & everything
    still works. Between the disable & re-enable, we must
    initiate an outside connection, so that the connection
    still works after the re-enable.
    I looked at the routing table via ROUTE PRINT before I
    disabled the NIC & after re-enabling it. I tried to modify
    the routing table so that the entries were the same after
    a re-boot as after the disable, re-enable scenario. The
    difference was an extra entry that I deleted, via a bat
    file that was scheduled to run when the server was
    started; the ROUTE DELETE command worked, but the problem
    wasn't resolved - remember that I must connect to another
    server between the disable & re-enable.

    Going through the disable, re-enable scenario does not
    resolve the SQL connection issue, but I still think the
    problems are somehow related.

    I don't think it is related, but the lead developer is
    convinced the problem is related to my running the IIS
    Lockdown utility on the server. He says the problem
    started after I ran it. I re-ran the utility to back-out
    the changes, but this didn't alleviant the problem either.
    I ran & re-ran the utility on the other servers without
    incident.

    Thanks for help.

    SK



    SK Guest

  16. #15

    Default Re: database connection

    have you tried using TCP/IP instead of named pipes?

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    [url]www.ielearning.com[/url]


    "SK" <SamLowry@Denton-Assoc.com.nnnnnn> wrote in message
    news:0b1d01c3bb4a$69733dc0$a501280a@phx.gbl...
    > I'm having trouble diagnosing a SQL Connection issue from
    > an ASP page.
    > Error Message: [Microsoft][ODBC SQL Server Driver][Named
    > Pipes} SQL Server does not exist or access denied.
    > Environment: Windows 2000 SP4, IIS, SQL 2000 SP3. SQL is
    > configured for Windows & SQL Authentication. In the Client
    > Connection Utility the enabled protocols are: Named Pipes
    > & TCP/IP; the order of their appearance does not impact
    > the issue.
    >
    > I know this is the standard SQL connection error message &
    > have researched the probable causes, none seem to apply.
    > The Intranet site has a GLOBAL.ASA with an Application
    > ("ConnectionString") = "Provider=MSDASQL;driver={SQL
    > Server}; Server=xxxxxxxx; Database= dbname; UID=userID;
    > PWD=password; DSN=' '". When the ASP pages need to connect
    > to the database they use this global connection parameter:
    > Set Conn = Server.CreateObject("ADODB.Connection")
    > Conn.open Application("ConnectionString")
    > Sql = "SELECT *.."
    > Set RS = Conn.Execute(SQL)
    > IF RS.EOF then
    > ....
    > What is confusing about this case is that we have a fat
    > client application that also accesses the same database;
    > once it connects to the database the ASP pages connect &
    > work fine. Also, the same applications are installed on
    > other servers that are not having this problem (the other
    > servers have the same operating environment). The
    > connection properties for both applications use a SQL user
    > account; the ISUR_machinename account is not used for
    > database access.
    >
    > There is another issue with this server that I suspect may
    > be related. This is a multi-homed server, where the other
    > servers are not. When we boot the system we are unable to
    > connect to other servers or the Internet. If we disable
    > one of the NICs, we can connect to the other locations. We
    > can then enable the NIC previously disabled & everything
    > still works. Between the disable & re-enable, we must
    > initiate an outside connection, so that the connection
    > still works after the re-enable.
    > I looked at the routing table via ROUTE PRINT before I
    > disabled the NIC & after re-enabling it. I tried to modify
    > the routing table so that the entries were the same after
    > a re-boot as after the disable, re-enable scenario. The
    > difference was an extra entry that I deleted, via a bat
    > file that was scheduled to run when the server was
    > started; the ROUTE DELETE command worked, but the problem
    > wasn't resolved - remember that I must connect to another
    > server between the disable & re-enable.
    >
    > Going through the disable, re-enable scenario does not
    > resolve the SQL connection issue, but I still think the
    > problems are somehow related.
    >
    > I don't think it is related, but the lead developer is
    > convinced the problem is related to my running the IIS
    > Lockdown utility on the server. He says the problem
    > started after I ran it. I re-ran the utility to back-out
    > the changes, but this didn't alleviant the problem either.
    > I ran & re-ran the utility on the other servers without
    > incident.
    >
    > Thanks for help.
    >
    > SK
    >
    >
    >

    Mark Schupp Guest

  17. #16

    Default Re: database connection

    > Error Message: [Microsoft][ODBC SQL Server Driver][Named
    > Pipes} SQL Server does not exist or access denied.
    (a) stop using MSDASQL/ODBC (see [url]http://www.aspfaq.com/2126[/url] for SQLOLEDB
    connection strings)

    (b) see [url]http://www.aspfaq.com/2082[/url] for information on forcing TCP/IP as
    opposed to Named Pipes.

    What is xxxxxxxx? Is this a server name, a fully qualified domain name, or
    an IP address? Try using an IP address, and/or making sure that the name
    resolves correctly (if you can't rely on your network's DNS for that, make
    sure there is an entry in the hosts file that resolves the correct IP).

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]






    Aaron Bertrand - MVP Guest

  18. #17

    Default Re: database connection

    > ("ConnectionString") = "Provider=MSDASQL;driver={SQL
    > Server}; Server=xxxxxxxx; Database= dbname; UID=userID;
    > PWD=password; DSN=' '".
    Why is there both a Server and a DSN parameter here ?

    Also, do not use the driver={SQL Server} user SQLOLEDB
    instead, like this:

    "Provider=SQLOLEDB.1; User ID=userid;Password=pwd;Initial Catalog=dbname;Data Source=server"

    PL.


    PL Guest

  19. #18

    Default database connection

    Thanks for the suggestions. I'll forward them to the
    developer.

    SK
    SK Guest

  20. #19

    Default database connection

    I am using DreamweaverMX with a web server for the first time. I am also not
    using IIS (money issue I believe). I have a problem of being able to open an
    existing site to update it. As the webserver is mapped on to my computer as a
    drive there is no root folder. I was wondering if anyone knew how to open the
    site to configure it without a root folder. I was also wondering if anyone
    knew if it was possible to use the existing db connection without having to
    start the site all over again (access database).

    Any help would be appreciated.

    Marie

    Marie_rose Guest

  21. #20

    Default Re: database connection

    Hi,
    a mapped networkdrive means you have drive letter and then it
    should be possible to map it as a root folder?
    And regarding the database issue: any details about operating system
    and what database system? (mysql, Postgres, Oracle, flat files,...)

    JR

    "Marie_rose" <webforumsuser@macromedia.com> schrieb im Newsbeitrag
    news:ccto33$coc$1@forums.macromedia.com...
    > I am using DreamweaverMX with a web server for the first time. I am also
    not
    > using IIS (money issue I believe). I have a problem of being able to
    open an
    > existing site to update it. As the webserver is mapped on to my computer
    as a
    > drive there is no root folder. I was wondering if anyone knew how to open
    the
    > site to configure it without a root folder. I was also wondering if
    anyone
    > knew if it was possible to use the existing db connection without having
    to
    > start the site all over again (access database).
    >
    > Any help would be appreciated.
    >
    > Marie

    Joachim Ritschmann Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139