Sign in to follow this  
Followers 0
hungttri

Help me func upate data

5 posts in this topic

Hi, I'm have a func to search for new Data. And every day I'm download new excel file from Email to "Shop" folder. Then I used Script to Search for new Data.

Now I would creat a Func to update that new data to my database. Please help me!!! Thank you and sorry for my bad english!

 

Here I'm Example for 4 data. Realistic I'm have more.

Quote

Local TB[100]

TB[1]="Hoang Hoa Tham.xlsx"

TB[2]="Truong Chinh.xlsx"

TB[3]="Pham Van Hai.xlsx"

TB[4]="Cong Hoa"

;..................

Search()

Func Search()
   Local $Tim = FileFindFirstFile("C:\Users\My PC\Desktop\Shop\*.*");
   If $Tim = -1 Then
        MsgBox(0, "Error", "File Not found.",1)
        Exit
   EndIf
   Local $File = "", $iResult = 0

While 1
      $File = FileFindNextFile($Tim)
    Select
        Case $File=$TB[1] or or $File=$TB[2] or $File=$TB[3] or $File=$TB[4]
            Sleep(10)
        Case Else
            MsgBox($MB_SYSTEMMODAL, "", '"'&$File&'" Is new Data, Do you want to update to Database')
            Exit
         EndSelect
WEnd
EndFunc 

 

 

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

hungttri

Help me func upate data

Started by hungttri, 15 minutes ago

 

funcupate sounds dirty.  Needing helping funcupating something else sounds even dirtier.

Edited by iamtheky

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

I don't know what data you're trying to update. I'm assuming you're trying to read the xlsx file?

Check out the Excel UDF.

Share this post


Link to post
Share on other sites

Like this:

My database is List.xls

Everyday I'm download Report folder on internet from my employee

My Script will search if file name in Report folder not equal any name data from List.xls then show message box and...

...I want when click button:  new Name will update to excel file.

Share this post


Link to post
Share on other sites

With your code you find for new files on a directory, thats it, but how do you know there is new data?

If you need to look inside the files and that are excel files then you need Excel UDF as @InunoTaishou already said.

Try to explain better what you want to do.

Kind Regards
Alien.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0