×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

DBF Database APP

DBF Database APP

DBF Database APP

(OP)
Hello,
I'm kinda new in VB 6.0. Let me explain the "problem". I work in a company that owns a supermarket chain. The payments for the aquisition of the merchandise is made at the home-office. The bills come at the supermarket locations.The software that records all the bills from the suppliers, installed in all the supermarket locations exports a dbf file wich contains the necesary information for the payments to be done. I want to write a program that enables the user to append the records from the dbf's daily into a global dbf file. Is it possible? Can anyone help me on this with a suggestion, or a link perhaps? 10x a lot
Reply With Quote
Hello,
This is the source code for the app so far. I use Microsoft Visual FoxPro OLE DB provider for the connection to be done.
Now I'm stuck on appending records from the .dbf from the supermarkets into a global dbf. To give a clear ideea of what I worked so far i'll give you the code. I wrote some comments for a clearer picture.


    'Author: Nedelea Ionutz
    'Company: SC IVET COMPROD SRL
    'Project name: Bexport/Import
    'Description: Headoffice bills payment solution
    'Location: Bucharest, Romania


    Private Sub cmdAppend_Click()
    'Triggers the common dialog box to fetch a dbf file
    With cdlgDBF
    .DialogTitle = "Cauta fisier DBF"
    .Flags = FileOpenConstants.cdlOFNPathMustExist Or FileOpenConstants.cdlOFNHideReadOnly
    .Filter = "Fisiere FoxPro (*.dbf)|*.dbf"
    .FileName = ""
    .FilterIndex = 1
    .ShowOpen
    End With
    'From now the click event of the cmdAppend button should append the records from the dbf
    'I selected with the common dialog box "cdlgDBF" to the adodc1.recordset
    'from this point on i'm lost

    End Sub
    'A command button cmdRaport that triggers a datareport to be shown
    Private Sub cmdRaport_Click()
    'Bind the datareport textboxes with the values
    With DataReport1.Sections("Section1").Controls
    .Item("txtPartener").DataField = Adodc1.Recordset("partener").Name
    .Item("txtData").DataField = Adodc1.Recordset("data").Name
    .Item("txtValCTVA").DataField = Adodc1.Recordset("ctva").Name
    End With


    Set DataReport1.DataSource = Adodc1.Recordset
    DataReport1.Show


    End Sub

    Private Sub DataGrid1_Click()
    'Afisarea inregistrarilor in textbox
    With Adodc1.Recordset
    txtMagazin.Text = !mag
    txtPartener.Text = !partener
    txtNrDocFurn.Text = !nrdocfurn
    txtValCTVA.Text = !ctva
    txtValfTva.Text = !ftva
    End With

    End Sub

    'Data sort ascending/descendig procedure triggered by the click event of the
    'column header of the datagrid
    Private Sub DataGrid1_HeadClick(ByVal ColIndex As Integer)
    'Declare the variables
    Dim strColName As String
    Static bSortAsc As Boolean
    Static strPrevCol As String

    strColName = DataGrid1.Columns(ColIndex).DataField

    If strColName = strPrevCol Then

    If bSortAsc Then
    Adodc1.Recordset.Sort = strColName & " DESC"
    bSortAsc = False
    Else
    Adodc1.Recordset.Sort = strColName
    bSortAsc = True
    End If

    Else
    Adodc1.Recordset.Sort = strColName
    bSortAsc = True
    End If
    strPrevCol = strColName
    End Sub

RE: DBF Database APP

This question doesn't have much to do with engineering. You will do better to ask on our sister site http://www.tek-tips.com

Make sure you search the site to get the right forum, and check out the FAQs first

Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting

Steam Engine enthusiasts: www.essexsteam.co.uk

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close