Welcome, Guest. Please Login.
05/25/25 at 06:17:47
News:
Home Help Search Login


Pages: 1 2 
Send Topic Print
Export Data Source (Read 6474 times)
nicknails
Ex Member



Export Data Source
07/13/07 at 10:53:44
 
I am using DBA Classic 2002.4.  I'm trying to export the data that appears on the Shipping Schedule in SO-O-E.  The information that I need is Customer Name, Item Number, Description, Ship Quantity, and Estimated Ship Date.  I have found the estimated ship date in BKARINVL.  However, I can't seem to find the field that determines if the sales order is open or closed.  When I export, it exports all sales order, including closed ones.  
 
My intention is to use the exported data in MS Project, or some other calendar program, to make a visual representation of when items are due.
Back to top
 
 
  IP Logged
Kelloggs
Active Member
*****


Do crazy people know
they are crazy?

Posts: 784
Gender: male
Re: Export Data Source
Reply #1 - 07/13/07 at 11:16:36
 
The column that you are looking for: BKAR_INV_INVCD is on table BKARINV.
You need a sql query like this:
 
SELECT
BKARINV.BKAR_INV_INVCD,
BKARINV.BKAR_INV_SONUM,  
BKARINV.BKAR_INV_CUSNME,  
BKARINV.BKAR_INV_ORDDTE,  
BKARINV.BKAR_INV_DESC,  
BKARINV.BKAR_INV_CUSORD,  
BKARINV.BKAR_INV_ENTBY,  
BKARINVL.BKAR_INVL_CNTR,  
BKARINVL.BKAR_INVL_PCODE,  
BKARINVL.BKAR_INVL_PDESC,  
BKARINVL.BKAR_INVL_PQTY,  
BKARINVL.BKAR_INVL_PPRCE,  
BKARINVL.BKAR_INVL_ESD  
FROM BKARINV INNER JOIN BKARINVL ON BKARINV.BKAR_INV_SONUM = BKARINVL.BKAR_INVL_INVNM  
WHERE BKARINV.BKAR_INV_INVCD <> 'Y' AND  BKARINV.BKAR_INV_INVCD <> 'X'
AND LENGTH(BKARINVL.BKAR_INVL_PCODE) <> 0
ORDER BY BKARINV.BKAR_INV_SONUM
 
 Tongue
 
Regards,
 
Kelloggs
Back to top
 
 

Evo ERP - 35 Users
Dumped MS Access like a hot potato (VB.Net rules!!!)
Email WWW   IP Logged
nicknails
Ex Member



Re: Export Data Source
Reply #2 - 07/13/07 at 11:42:26
 
Unfortunately, we don't have the ability to do sql queries.  I was just going to export to a delimited text file and then import to excel.  Is there any way to export from multiple files at the same time and add them into one text file?
Back to top
 
 
  IP Logged
Kelloggs
Active Member
*****


Do crazy people know
they are crazy?

Posts: 784
Gender: male
Re: Export Data Source
Reply #3 - 07/13/07 at 11:50:02
 
You can use sql queries. Use Pervasive Control Center. Select the Database then rigth click on it
All Task, then "Export Data". Also you can call "C:\PVSW\Bin\ExpWizrd.exe"
 
Enter the File Name ( Location), then paste the query  Tongue
 
Also, check with Lynn about the Sales Order Status, as far as I know if it is diferent than "Y" or "X" the SO is open.
 
Regards,
 
Kelloggs
 
Back to top
 
 

Evo ERP - 35 Users
Dumped MS Access like a hot potato (VB.Net rules!!!)
Email WWW   IP Logged
Kelloggs
Active Member
*****


Do crazy people know
they are crazy?

Posts: 784
Gender: male
Re: Export Data Source
Reply #4 - 07/13/07 at 12:02:30
 
Here is nice VBA Code to import data from a text file. Already test works great.
 
 Tongue
 
 
Sub GetTextFileData(strSQL As String, strFolder As String, rngTargetCell As Range)
Dim cn As ADODB.Connection, rs As ADODB.Recordset, f As Integer
    If rngTargetCell Is Nothing Then Exit Sub
    Set cn = New ADODB.Connection
    On Error Resume Next
    cn.Open "Driver={Microsoft Text Driver (*.txt; *.csv)};" & _
        "Dbq=" & strFolder & ";" & _
        "Extensions=asc,csv,tab,txt;"
    On Error GoTo 0
    If cn.State <> adStateOpen Then Exit Sub
    Set rs = New ADODB.Recordset
    On Error Resume Next
    rs.Open strSQL, cn, adOpenForwardOnly, adLockReadOnly, adCmdText
    On Error GoTo 0
    If rs.State <> adStateOpen Then
        cn.Close
        Set cn = Nothing
        Exit Sub
    End If
    ' the field headings
    For f = 0 To rs.Fields.Count - 1
        rngTargetCell.Offset(0, f).Formula = rs.Fields(f).Name
    Next f
    rngTargetCell.Offset(1, 0).CopyFromRecordset rs ' works in Excel 2000 or later
    'RS2WS rs, rngTargetCell ' works in Excel 97 or earlier
    rs.Close
    Set rs = Nothing
    cn.Close
    Set cn = Nothing
End Sub
Function getdata()
    Application.ScreenUpdating = False
    GetTextFileData "SELECT * FROM DBA.txt", "D:\", Range("A3")
'    GetTextFileData "SELECT * FROM filename.txt WHERE fieldname = 'criteria'", _
        "C:\FolderName", Range("A3")
    Columns("A:IV").AutoFit
    ActiveWorkbook.Saved = True
End Function
Back to top
 
 

Evo ERP - 35 Users
Dumped MS Access like a hot potato (VB.Net rules!!!)
Email WWW   IP Logged
nicknails
Ex Member



Re: Export Data Source
Reply #5 - 07/13/07 at 12:14:42
 
Ok, I sort of got it working.  At least now I'm on the right track.  I have some errors with the sql, something about not being able to open bkarinv.  It might be because people are logged in.  Is there any way to do this from a remote terminal?  I tried on my station and the export functions are grayed out.  I'll be leaving shortly, so I'll have to play around with it monday.  Thank for your help Kelloggs.
Back to top
 
 
  IP Logged
Kelloggs
Active Member
*****


Do crazy people know
they are crazy?

Posts: 784
Gender: male
Re: Export Data Source
Reply #6 - 07/13/07 at 12:29:28
 
We use terminal server. Same thing.
 
SQL Queries work a little bit diferent. I dont think that because other user are using DBA the table is locked!. There must be something else.
 
Regards,
 
Kelloggs
Back to top
 
 

Evo ERP - 35 Users
Dumped MS Access like a hot potato (VB.Net rules!!!)
Email WWW   IP Logged
nicknails
Ex Member



Re: Export Data Source
Reply #7 - 07/16/07 at 07:10:35
 
So I've started to play around with this and I'm still having issues.  It seems to me that the database that we use isn't registered with pervasive.  In the pervasive control center, the only database listed is DEMODATA, which I have verified it not ours.  Now I am more confused than before.  What would happen if I were to create a new database that's in the same directory as our current database?  Would it use pre-existing files?  I'm more confused now.....    undecided
Back to top
 
 
  IP Logged
Kelloggs
Active Member
*****


Do crazy people know
they are crazy?

Posts: 784
Gender: male
Re: Export Data Source
Reply #8 - 07/16/07 at 07:46:24
 
Login into DBA
goto System Manager
Run UT-J
Open UT-A
Type/Run ODBCDDF.RUN
 
Go back to your Pervasive Control Center
 
select your server
select databases
rigth click New Database
Name it and include the path
 
it should work now.
 
Regards,
 
Kelloggs
 
 
 
Back to top
 
 

Evo ERP - 35 Users
Dumped MS Access like a hot potato (VB.Net rules!!!)
Email WWW   IP Logged
nicknails
Ex Member



Re: Export Data Source
Reply #9 - 07/16/07 at 13:58:40
 
I got the database configured in the pervasive control panel.  The SQL script doesn't do anything.  I checked the tables and everything has either an X or a Y in the INVCD field.  Are you sure that's the field that determines an open sales order?
Back to top
 
 
  IP Logged
Kelloggs
Active Member
*****


Do crazy people know
they are crazy?

Posts: 784
Gender: male
Re: Export Data Source
Reply #10 - 07/16/07 at 14:09:23
 
Quote from Kelloggs on 07/13/07 at 11:50:02:


Also, check with Lynn about the Sales Order Status, as far as I know if it is diferent than "Y" or "X" the SO is open.

Regards,

Kelloggs


 
Actually send a email to  NovaZyg, He will be the best person to confirm the "XX/XY" dilemma
 
 
 Tongue
Back to top
 
 

Evo ERP - 35 Users
Dumped MS Access like a hot potato (VB.Net rules!!!)
Email WWW   IP Logged
NovaZyg
Administrator
*****


When all else
fails.. Read the
instructions.

Posts: 789
Gender: male
Re: Export Data Source
Reply #11 - 07/17/07 at 06:10:00
 
INVCD can be "Y" for invoiced
                    "V" for Void
                    " " for just entered and open
                    "X" for edited but still open
 
 
Hope this helps.
Back to top
 
 

Allen Landry
Evo~ERP

EvoERP and DBA Classic always Beta's of the Latest versions.

WWW   IP Logged
nicknails
Ex Member



Re: Export Data Source
Reply #12 - 07/17/07 at 06:47:17
 
Excellent, I will give that a try.  The code originally had both X and Y as closed work orders.  I'll let you know how it goes.
Back to top
 
 
  IP Logged
nicknails
Ex Member



Re: Export Data Source
Reply #13 - 07/17/07 at 08:18:05
 
I got the data into the text file.  I have to do numerous edits in Excel, but I got the data that I need.  Now I just have to do the calendar part.
 
Do you know off-hand if I have to keep redoing the DDF files?  Or are those just constant?
Back to top
 
 
  IP Logged
Kelloggs
Active Member
*****


Do crazy people know
they are crazy?

Posts: 784
Gender: male
Re: Export Data Source
Reply #14 - 07/17/07 at 08:28:06
 
Quote from nicknails on 07/17/07 at 06:47:17:
Excellent, I will give that a try.  The code originally had both X and Y as closed work orders.  I'll let you know how it goes.

 
Work Orders?
 
Anyways, You dont need to redo the DDF Files.
 
I am working on a Report similar to yours. I will send you my email so that we can exchange ideas.
 
Regards,
 
Kelloggs
 
Back to top
 
 

Evo ERP - 35 Users
Dumped MS Access like a hot potato (VB.Net rules!!!)
Email WWW   IP Logged
Pages: 1 2 
Send Topic Print