If you wish to use any ocx or dll that is not included in the basic vb workspace you will need to include a copy. This copy can be placed in either the folder in which the compiled executable is located or the system32 folder.
Try looking into the Package and Deployment wizard, it automates the process for you.
You can also look up how to use resource files with your application as another alternative.
If a post has been helpful please rate it.
If your question has been answered, pull down the tread tools and mark it as resolved.
ok i got it but it has an error before it registers the ocx file i tried the "on error resume next" but it didnt work...it says that the file is missing
it should be registered by the installation package, if it is not being registered by the installation, you need to look at the method you are using to build the package, if you don't figure this try the application deployment forum
i don't believe you can register an OCX, or other referenced file, from within your program, as they are referenced as soon as the program starts
if you do not wish to deploy the inet ocx you can probably use api functions to do ftp upload, which will not require any additional files
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
server = InternetConnect(session, ftpserver, INTERNET_INVALID_PORT_NUMBER, user, pass, 1, 0, 0)
ret = FtpPutFile(server, localfile, remotefile, FTP_TRANSFER_TYPE_BINARY, 0)
InternetCloseHandle server
InternetCloseHandle session
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
make a new project, add the module, put the code above in a command button event, edit to give real values for localfile, remotefile, ftpserver, user and pass,
do not use app.path unless you save the project first, make sure some file is in the correct place (path\filename) for localfile
ret will = 1 if the file uploads correctly
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
what is the value of ret after the upload, put
msgbox ret
on the line after ftpputfile, see what the return value is
If i have a folder called "data1" on my server
your local computer or the ftp server??
unless you change directory on the ftp server it will upload to the current root directory, changing the file name will not affect the folder it is copied into, if the folder is not on the local computer the file will not be found to upload
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
I put msg box, and it was "0" . I changed the "\data1\" to "\" and then msg was "1" , i checked and i found my file.txt on root directory.
I tried so many options before and i failed everytime :P but , anyway, thanks westconn1
I don't know how to set the directory \data1\ instead of root, but it's not very important, ok, going to read some more papers about VB