dbTalk Databases Forums  

.ASP to connect to Pervasive(Macola) Database

comp.databases.btrieve comp.databases.btrieve


Discuss .ASP to connect to Pervasive(Macola) Database in the comp.databases.btrieve forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
j.t.w@juno.com
 
Posts: n/a

Default .ASP to connect to Pervasive(Macola) Database - 12-08-2004 , 05:51 PM






Hi All,

I am trying to display data from a Macola table in an .ASP page. I have
this working for an Access2k database, but don't know how to connect to
a Pervasive table.

I have tried...
objConn_01.Provider="Pervasive ODBC Client Interface"
but it doesn't work.

Other Specs (if needed)...
Pervasive.SQL 2000i
Progression Series 7.5.103f

Here is what I have so far (with Access that works)...
-----------------------------------------
----- Start of Code ---------------------
-----------------------------------------
<%
'--------- Connection Variables
Dim ObjConn_01, ObjRec_01, sSql_01

Set objConn_01 = Server.CreateObject ("ADODB.Connection")
Set objRec_01 = Server.CreateObject ("ADODB.Recordset")

objConn_01.Provider="Microsoft.Jet.OLEDB.4.0"
objConn_01.Open "\\MyPath\MyDatabase.mdb"

'---------Variables used for retrieved data
Dim getData_01, Cus_No_01, Cus_Name_01

sSql_01 = "Select * " _
& "FROM temp_ARCUSFIL_SQL"

Set ObjRec_01 = ObjConn_01.Execute(sSql_01)
Set getData_01 = ObjConn_01.Execute(sSql_01)

Set Cus_No_01 = getData_01("Cus_No")
Set Cus_Name_01 = getData_01("Cus_Name")

Response.Write("<table>")
Do Until getData_01.eof
Response.Write("<tr>")
Response.Write("<td>")
Response.Write(Cus_No_01)
Response.Write("</td>")
Response.Write("<td>")
Response.Write(Cus_Name_01 & "<br>")
Response.Write("</td>")
Response.Write("</tr>")
getData_01.MoveNext
Loop
Response.Write("</table>")

' ---------------------- Close Objects -------------------
Set objConn_01 = Nothing
Set objRec_01 = Nothing
%>

-----------------------------------------
----- End of Code -----------------------
-----------------------------------------

I have linked the ARCUSFIL_SQL table in the MyDatabase.mdb. I appended
the ARCUSFIL_SQL data to the temp_ARCUSFIL_SQL table (just to get it
working).

Could someone please tell me what I'm doing wrong and what I need to do
to get this working.

Thanks in advance.
j.t.w


Reply With Quote
  #2  
Old   
Bill Bach
 
Posts: n/a

Default Re: .ASP to connect to Pervasive(Macola) Database - 12-13-2004 , 08:51 AM






A DSN-less connection in its simplest form would look like this:
Set Conn = Server.CreateObject("ADODB.Connection")
dbPath = "c:\pvsw\demodata"
Conn.Open "DBQ=" & dbPath & ";DRIVER={Pervasive ODBC Client Interface};"

You can also create a DSN and use "DSN=" in the connection string -- this
would be MUCH easier (and best supported) in the long run.
Goldstar Software Inc.
Building on Btrieve(R) for the Future(SM)
Bill Bach
BillBach (AT) goldstarsoftware (DOT) com
http://www.goldstarsoftware.com
*** Pervasive.SQL Service & Support Classes ***
Coming Soon: Pervasive DataExchange Training!


j.t.w (AT) juno (DOT) com wrote:

Quote:
Hi All,

I am trying to display data from a Macola table in an .ASP page. I have
this working for an Access2k database, but don't know how to connect to
a Pervasive table.

I have tried...
objConn_01.Provider="Pervasive ODBC Client Interface"
but it doesn't work.

Other Specs (if needed)...
Pervasive.SQL 2000i
Progression Series 7.5.103f

Here is what I have so far (with Access that works)...
-----------------------------------------
----- Start of Code ---------------------
-----------------------------------------
%
'--------- Connection Variables
Dim ObjConn_01, ObjRec_01, sSql_01

Set objConn_01 = Server.CreateObject ("ADODB.Connection")
Set objRec_01 = Server.CreateObject ("ADODB.Recordset")

objConn_01.Provider="Microsoft.Jet.OLEDB.4.0"
objConn_01.Open "\\MyPath\MyDatabase.mdb"

'---------Variables used for retrieved data
Dim getData_01, Cus_No_01, Cus_Name_01

sSql_01 = "Select * " _
& "FROM temp_ARCUSFIL_SQL"

Set ObjRec_01 = ObjConn_01.Execute(sSql_01)
Set getData_01 = ObjConn_01.Execute(sSql_01)

Set Cus_No_01 = getData_01("Cus_No")
Set Cus_Name_01 = getData_01("Cus_Name")

Response.Write("<table>")
Do Until getData_01.eof
Response.Write("<tr>")
Response.Write("<td>")
Response.Write(Cus_No_01)
Response.Write("</td>")
Response.Write("<td>")
Response.Write(Cus_Name_01 & "<br>")
Response.Write("</td>")
Response.Write("</tr>")
getData_01.MoveNext
Loop
Response.Write("</table>")

' ---------------------- Close Objects -------------------
Set objConn_01 = Nothing
Set objRec_01 = Nothing
%

-----------------------------------------
----- End of Code -----------------------
-----------------------------------------

I have linked the ARCUSFIL_SQL table in the MyDatabase.mdb. I appended
the ARCUSFIL_SQL data to the temp_ARCUSFIL_SQL table (just to get it
working).

Could someone please tell me what I'm doing wrong and what I need to do
to get this working.

Thanks in advance.
j.t.w


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.