Ask a Question related to ASP, Design and Development.
-
Chris Barber #1
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
-
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... -
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... -
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... -
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... -
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... -
Bob Barrows #2
Re: database connection
Ajay wrote:
You've done too many steps here. One line is all that's needed:> 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()
>
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
-
varun varun #3
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
-
Kevin Spencer #4
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
-
Chris Barber #5
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...news:<ez$hXqiQDHA.3796@tk2msftngp13.phx.gbl>...> "Chris Barber" <chris@blue-canoe.co.uk.NOSPAM> wrote in message(such> > That's not 100% correct. You can return early bound object referencesfunction> > as ADODB.Connection) but you can't pass them in as parameters ofcan't> > 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)object> > 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 boundADODB.Recordset>> > 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) asNow> > 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.returns> > > > when i use this dll in vb6.0 project and call the function, itthe> > > > the connection object to adodb.connection object in my project andand> > > > connection is made.
> > > >
> > > > But when i use the same DLL in one of the forms of the asp projectLike> > > > 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?> > Remember,> > > this?
> > > Public Function GetConnection AS ADODB.Connection
> > >
> > > If so, this will fail. The vb dll has to return a variant to vbs.> > > the only datatype in vbs is the variant.
> > >
> > > Bob Barrows
> > >
> > >
> > >
Chris Barber Guest
-
Chris Barber #6
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...years.> 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 threeString,>
> 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*have*> 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 youcould> returned an ADODB.Connection object - albeit one where the connectionmessage?> not be established!
>
> Chris.
>
>
> Chris.
>
>
>
> "Ajay" <ar_doc2@yahoo.co.in> wrote in message
> news:cdc73bc1.0307092242.907f7e4@posting.google.co m...> news:<ez$hXqiQDHA.3796@tk2msftngp13.phx.gbl>...> > "Chris Barber" <chris@blue-canoe.co.uk.NOSPAM> wrote in message> (such> > > That's not 100% correct. You can return early bound object references> function> > > as ADODB.Connection) but you can't pass them in as parameters of> can't> > > 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)> object> > > 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> ADODB.Recordset> >> > > 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> Now> > > 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.> returns> > > > > when i use this dll in vb6.0 project and call the function, it> the> > > > > the connection object to adodb.connection object in my project and> and> > > > > connection is made.
> > > > >
> > > > > But when i use the same DLL in one of the forms of the asp project> > > > > 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> Like> > > >
> > > > Without details, we can only guess, so:
> > > >
> > > > How have you declared your vb function that returns the connection?>> > > > 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
-
Ajay #7
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...> years.> > 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> String,> >
> > 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> *have*> > 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> could> > returned an ADODB.Connection object - albeit one where the connection> news:<ez$hXqiQDHA.3796@tk2msftngp13.phx.gbl>...> > 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> (such> > > > That's not 100% correct. You can return early bound object references> function> > > > as ADODB.Connection) but you can't pass them in as parameters of> can't> > > > 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)> object> > > > 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> ADODB.Recordset> > > > 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> Now> > > > 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.> returns> > > > > > when i use this dll in vb6.0 project and call the function, it> the> > > > > > the connection object to adodb.connection object in my project and> and> > > > > > connection is made.
> > > > > >
> > > > > > But when i use the same DLL in one of the forms of the asp project> message?> > > > > > 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> Like> > > > >
> > > > > Without details, we can only guess, so:
> > > > >
> > > > > How have you declared your vb function that returns the connection?> Remember,> > > > > this?
> > > > > Public Function GetConnection AS ADODB.Connection
> > > > >
> > > > > If so, this will fail. The vb dll has to return a variant to vbs.> >> > > > > the only datatype in vbs is the variant.
> > > > >
> > > > > Bob Barrows
> > > > >
> > > > >
> > > > >
> >Ajay Guest
-
Chris Barber #8
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...news:<#8GYMJrRDHA.2228@tk2msftngp13.phx.gbl>...> 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 messagesa> > Good job thats an internal SQL database then if I'm going to plaster theByVal> > 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...> > years.> > > 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> > >
> > > 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,As> > String,> > > strSQLServerInitialCatalog As String, Optional ByVal strSQLUserID As> > > Optional ByVal strSQLPwd As String, Optional ByVal plngTimeoutSecondsIIS> > > Long) As ADODB.Connection
> > >
> > > ... implementation ...
> > >
> > > End Function
> > >
> > > So ... are you sure that your connection string is valid and that the[snip]> > *have*> > > user context has permissions to access the data source?
> > >
> > > BTW: If you can actually see that the connection state is 0 then you> > could> > > returned an ADODB.Connection object - albeit one where the connection> > > not be established!
> > >
> > > Chris.
> > >
Chris Barber Guest
-
Reddy #9
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
-
Ravikanth[MVP] #10
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]
display results in>-----Original Message-----
>Is there any way to connect to a Foxpro database to>asp.net (c#) application.
>Any sample code would be nice.
>
>Reddy
>
>
>.
>Ravikanth[MVP] Guest
-
Reddy #11
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]
>
>
>> display results in> >-----Original Message-----
> >Is there any way to connect to a Foxpro database to> >asp.net (c#) application.
> >Any sample code would be nice.
> >
> >Reddy
> >
> >
> >.
> >
Reddy Guest
-
John Doe #12
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
-
Bob Barrows #13
Re: database connection
John Doe wrote:
See this message:> 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.
[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
-
SK #14
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
-
Mark Schupp #15
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
-
Aaron Bertrand - MVP #16
Re: database connection
> Error Message: [Microsoft][ODBC SQL Server Driver][Named
(a) stop using MSDASQL/ODBC (see [url]http://www.aspfaq.com/2126[/url] for SQLOLEDB> Pipes} SQL Server does not exist or access denied.
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
-
PL #17
Re: database connection
> ("ConnectionString") = "Provider=MSDASQL;driver={SQL
Why is there both a Server and a DSN parameter here ?> Server}; Server=xxxxxxxx; Database= dbname; UID=userID;
> PWD=password; DSN=' '".
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
-
SK #18
database connection
Thanks for the suggestions. I'll forward them to the
developer.
SK
SK Guest
-
Marie_rose #19
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
-
Joachim Ritschmann #20
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...not> I am using DreamweaverMX with a web server for the first time. I am alsoopen an> using IIS (money issue I believe). I have a problem of being able toas a> existing site to update it. As the webserver is mapped on to my computerthe> drive there is no root folder. I was wondering if anyone knew how to openanyone> site to configure it without a root folder. I was also wondering ifto> knew if it was possible to use the existing db connection without having> start the site all over again (access database).
>
> Any help would be appreciated.
>
> Marie
Joachim Ritschmann Guest



Reply With Quote

