Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB PROG>> ACCESS TO EXCEL>>>>PERVASIVE TO EXCEL

Status
Not open for further replies.

JRHEIN

MIS
Feb 6, 2007
18
US
Hey Everyone,

I recently wrote a prog in vb to extract data from access into excel. What I really need to do is to extract live data from pervasive 2000i into excel. So, my question is....How tuff is it going to be to taylor the access to excel prog to pervasive to excel? I've been working through some trouble shooting and ran into a snag! Anyones help would be appreciated!


This is some of the code logic i've used thus far


how do i define pervasive in vb?

Private Sub cmdLoad_Click()
Dim excel_app As Object
Dim excel_sheet As Object
Dim row As Long
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim statement As String
Dim col As Integer

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

Here is where I open the db and connect!

Set conn = New ADODB.Connection
conn.ConnectionString = _
"Provider=MSDASQL;" & _
"Driver ={Pervasive ODBC Client Interface};" & _
"SeverName=" & server & ";" & _
"ServerName=" & server & ";" & _
"ServerDSN=summit" & _
co & _
ayear & ";" & _
"UID=Mas" & _
"ter;PWD=AL" & _
"EX"

conn.Open
-----------------------------

Private Sub Form_Load()
Dim file_path As String

file_path = App.Path
If Right$(file_path, 1) <> "\" Then file_path = file_path & "\"
txtExcelFile.Text = file_path & "empty_steve_project.xls"
???????????????? = file_path & "C:\Query's\111TEST.sql"
End Sub




Thanks,
JRHEIN
IS ADMIN
 




Hi,

Unless you have to do alot of record by record manipulating, I'd suggest using MS Query from the worksheet in Excel, via Data/Get External Data/New Database Query...

You can use the QBE editor and/or write/modify the SQL yourself. When you File/Return data to Excel, a QueryTable is added to the sheet. Unless you have variable parameters, all you have to do to get a new resultset is Data/Refresh the QueryTable.

You can macro record editing the QueryTable and generate the code that does the connect and command.

Otherwise, you ran into a snag? Tell me about it. Did a line of code error? Post your code.


Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Skip,
Your a lifesaver! I'm a fairly new IS ADMIN for a huge privately owned company and was banging my head against the wall trying to debug this prog. I had forgoten about MS Query (duh)! I probably shouldn't but I can now abandon my program and move on to more important issues. I was designing the program to make life easier for multiple users that are constantly bombarding me with short and simple db extraction!

Regards,
JRHEIN
IS ADMIN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top