Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Use Wildcards With FtpGetFile (of Wininet.dll)


Can you tell me how can I get multiple files using FtpGetFile?. I only can get one file with this command. I thanks to everybody that send me an example code.Tanks to everybody.FeReNZCy




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Searching Wildcards SQL...can I Ignore Wildcards In Memo/text Fields?
Hi,

I have a access database, full of memo text records. Some of these records include text that have "?"

In a VB loop, I am going through records, getting the memo field, then checking against the whole database for other records with exact same text.
However, because I am using SQL to do a search against the memo field with a string containing the original memo text (which includes the "?") - my searches are coming back empty.

I know we can get around quotes, by doubling them up in a VB string, but how do you do it with wildcards.... I've tried "??" but it doesn't cancel it out, just looks for 2 single character wildcard matches....

Thanks!

Ftpgetfile
Hello,
I am developing a FTP program to get some files from FTP server.
I am using FTPGETFILE this API and it works fine. When doing the testing, i try to disable the connection (unplug the network cable) but this API doesnt return and hang... Can anyone know how to solve this problem?
I am using window 98 for developemnt and i found this API return in window XP..

Thomas

FTP Using FTPGetFile
I am writing a VB 6.0 program that is using Wininet api to perform FTP functions. Iím connecting to an FTP site that first requires a firewall id and password then a site id and password.

Iíve set it up to first perform InternetOpen then InternetConnect twice Ė first against with the firewall id/password and then with the site id/password. These operations seem to work correctly. When I attempt a FTPGetFile I receive a 12003 error Ė Internet Extended Error.

Because Iíve used the InternetConnect twice I have two session ids. Iíve tried the FTPGetFile with both of them but receive the same error. The file Iím trying to download is a zip file.

I'm thinking the problem is the firewall because when I try the process within the firewall (using only 1 InternetConnect) it works. Am I handling the firewall correctly or do I have to combine the 2 InternetConnectís? If so, how?

Thanks in advance,
Rich

FtpGetFile Api
Hello all
Is it possible to build a progress bar to show the progress of the download?
I use the FtpGetFile api in vb6.

Ftpgetfile SIZE
I am wanting to know if there is a way to disable the size command when using get file.
EXAMPLE .
"PORT 127,0,0,1,4,135
SIZE CURRENT
RETR CURRENT
Data session connected with client (Port)"
above is what appears on the ftp-server when passing the command using the wininet.dll getfile with my visual basic program.

when I go to the Command prompt and do a get file the ftp-server does not have the SIZE. thanks

FtpGetFile Extd Err
I use a very typical sample VB program downloaded from website using FTP WinInet APIs (but not Microsoft Inet control, for Inet control can not transfer the Ascii text file by executing "GET" command, only the binary) transfer files from/to remote mainframe server.

And I am stuck with this function: FtpGetFile for the following error messages: (this function always return false)

rcd Extd Err: 0 550 CWD cmd failed: EDC5129I No such file or directory.

then:
FtpGetFile Err: 0 200 Representation type is Ascii NonPrint
227 Entering Passive Mode(159,83,73,4,7,223)
501 command aborted --FTP server not configured for SIZE
550 Name length error for pathname 01 1 15 VB 255 6233 PS SYSTC.MYTEST.DATA

I am wondering if I need to figure out the configuration in our FTP server for the file SIZE particularly, for each listed file in the remote server, I don't see the size being specified, except the file name, file type, date modified, size column always show blank, is this cause the problem?

Thank you for any input!

FTPGetFile Problem
I'm using the FTPGetFile function to try and download a file from an FTP server onto the local machine running my app.

The function calls all goes swimmingly well, no errors, and even creates the right file in the right place on the local machine!
However, the file it creates is zero length! There is no data in it!! (The original on the FTP host definately does!)

This is the code im using:

----------------------------------------------
If hInetConn Then

'If we've been given a remote
'path then change to it
If sFilePath <> "" Then

ChangeDir (sFilePath)

End If

'Add a "" to the local path if it needs it
If sDownloadPath <> "" Then
sNewFile = MakeDOSDir(sDownloadPath) & sFilename
Else
sNewFile = sFilename
End If


'Download the file
If FtpGetFile(hInetConn, _
sFilename, _
sNewFile, _
False, _
FILE_ATTRIBUTE_ARCHIVE, _
FTP_TRANSFER_TYPE_UNKNOWN, _
0&) Then

GetFile = True

Else

'Log the error
LogError (GetFTPErr(Err.LastDllError))
GetFile = False

End If 'If FtpGetFile


End If

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

This code is part of a function (GetFile) that receives as its arguments:

sFilename - the filename to download
sFilePath - the remote path on the FTP server (optional)
sDownloadPath - the local dir to download to (optional)

Like I said, no errors occur and it gives the appearance of having worked OK - until the file size is checked!!! Anyone got any ideas???

Thanks

FtpGetFile - PROBLEM
I had some files residing in a remote server. A dll had been done to retrieve a file from the remote server.
The naming conventions of the files are abcnn.yy where nn and yy are not fixed. Only abc is fixed. I need to copy the files from the remote server where the exact filenames are not known due to nn and yy.

The dll can get file by specifying the remote filename currently by calling the dll and passing the parameters as


Remote server IP address,'c: est est.txt','/test ext.txt',username,password


Can I specify the remote filename as /testabc*.* so I can get whatever file that is residing at the server. The file retrieve from the server to local workstation will follow the remote server filename.

all vb experts .........PLs help........ emergency...............

live - threatening



below is my clsFtpGet (ActiveX DLL project type)


Public Function FtpGetApi(IPAddress As String, LocalFile As String, RemoteFile As String, UserName As String, Password As String) As String

Dim lngINet As Long
Dim lngInetConn As Long
Dim intError As Integer
Dim pingres As String
Dim errpos As Byte
On Error GoTo err1

' Open an internet session (without proxy)
' To connect through a proxy 2nd parameter = 3

errpos = 0

lngINet = InternetOpen("Billing Computer System", 1, vbNullString, vbNullString, 0)

' After creating the session connect to the server

If lngINet = 0 Then
'Cannot Connect to Internet
ftpGetError = "Cannot Connect to Internet"
FtpGetApi = "N"
Exit Function
End If

errpos = 1 ' denoting session created

lngInetConn = InternetConnect(lngINet, IPAddress, 0, UserName, Password, 1, 0, 0)

If lngInetConn = 0 Then
'Cannot Connect to Server
ftpGetError = "Cannot Connect to Server"
FtpGetApi = "N"
' close the handle before exiting
InternetCloseHandle lngINet
MsgBox ("Cannot Connect to Server")
Exit Function
End If

errpos = 2 ' denoting server connected

' After establishing the connection send the file
' 4th parameter - 1 - Ascii file transfer
' - 2 - Binary file trasnfer

FileSchedule = ""
FileRecd = ""

If FtpGetFile(lngInetConn, RemoteFile, LocalFile, 0, 0, 1, 0) Then
FtpGetApi = "Y"
Else
FtpGetApi = "N"
End If

If FtpGetApi = "N" Then
ftpGetError = "File is not able to be retrieve"
End If

errpos = 3 ' denoting err while sending

' Close the handles created

InternetCloseHandle lngInetConn
InternetCloseHandle lngINet

errpos = 4 'No errors
'no action
' sending status is true always even if file not sent
Exit Function

err1:

Debug.Print "Error : " & Err.Number & " " & Err.Description

'close the handles created above incase they are not closed
Select Case errpos
Case 1
InternetCloseHandle lngINet
Case 2
InternetCloseHandle lngInetConn
InternetCloseHandle lngINet
End Select

End Function

FtpGetFile And GetLastError
Hi!!

I'm using FtpGetFile api and it returns me false even if there are no bad conditions.
I wanted to add GetLastError to know why it gives me that false, but I don't understand how I have to use it.

In msds site I read that GetLastError returns the value set with the SetLastError, but I can't set the error!

How do I have to do??

thank you

FTPGetFile And Freezing
I have my app built and it works great, but I do not like the fact that when it hands control over to the DLL to get the file from the server using FTPGetFile the app looks frozen. I have seen other posts on this, but no resolution.

Does anyone out there have any ideas? Someone said to use an OCX instead of a DLL but I don't really understand this. Anyone have the same problem and got a better solution?

Thanks in advance.

FtpGetFile Question
Hi,

Using the following API, does anyone know how many bytes at a time this function will retrieve, or does it just download the entire file???


VB Code:
Private Declare Function FtpGetFile Lib "wininet.dll" _    Alias "FtpGetFileA" _    (ByVal hOutboundSession&, _    ByVal lpszRemoteFile$, _    ByVal lpszNewFile$, _    ByVal fFailIfExists As Boolean, _    ByVal dwFlagsAndAttributes&, _    ByVal dwFlags&, _    ByVal dwContext&) As Boolean


I'm asking this because I've created an ftp program which our customer uses to download files that another company sends it regularly. We had a problem for the first time yesterday in that 2 files were not complete.

Currently, we think that the problem is not in our software and that the problem lies with the company that sent the files. Up to now, I thought that if a file was not successfully downloaded completely, that no file would appear in the local directory, but now I am not sure anymore. Does anyone know?????

Thanks for any help, I appreciate it!

FtpGetFile - GetLastError
Hi,

I have successfully used FtpGetFile but I also need to test exceptions. I ran another test to Get a m/f file and FTP it to my c: emp directory. I set fFailIfExists to TRUE and ran another test. I made sure I already had a file in the directory so the Get would fail.

I received a return code of FALSE as expected. I then called GetLastError to try to get a specific error code. It returned 0.

I would like to be able to send a return code or display an error message saying something like "File already exists - Get failed".

Since GetLastError doesn't seem to work is there any way to get a specific error message or am I doing something wrong. My code for the GetLastError is:

Dim ErrorCode As Integer
ErrorCode = GetLastError()

Thanks,

Jim

FTP - Pb TimeOUt With API FtpGetFile
HEllo all!

I have big trouble with the DLL Wininet.dll. My pb is :
If the FTP server disconnect me when i try to retrieve a file from its, the API used (FtpGetFile) doesn't stop and loop =&gt; and i need to kill my soft with taskman
i try to put an API Timer with a CreateThread / TerminateThread but, FtpGetFile stills runs, despite the end of the thread's container ?!?
i try this and it doesn't work

' event Sub call by Windows for a Timer
public Sub TimerProc(byval hwnd as Long, byval uMsg as Long, byval idEvent as Long, _
byval dwTime as Long)

iComp = iComp + 1
Debug.print "Compteur : " & iComp & " / 3"
If iComp &gt; 3 then
' close the last thread
Debug.print "Transfert Stopped"
KillTimer Form1.hwnd, 0
CloseHandle hThread
TerminateThread hThread, 0
End If
Exit Sub
End Sub

' Sub call by a CreateThread
public Sub AsyncThread()

Dim lngTimerID as Long

iComp = 0
lngTimerID = SetTimer(Form1.hwnd, 0, 1000, AddressOf TimerProc)

Debug.print "Connexion : " & mlConnection & "FileOrig : " & sServerFileAndPath & "FileDest: " & sDestinationFileAndPath
If FtpGetFile(mlConnection, sServerFileAndPath, sDestinationFileAndPath, false, INTERNET_FLAG_RELOAD, FTP_TRANSFER_TYPE_ASCII, 0) = false then
Debug.print "Bad luck for u"
End If

KillTimer Form1.hwnd, 0

End Sub




Plz help me! thx

Trouble With FTPGetFile From Unix
I am using the wininet API to get files (ftp) to my local machine.

The remote machine is Unix, and when the file is received and i open it with notepad, i get all linefeeds are gone, and a square sign is put where the crlf should be.

i have tried changing between binary and ascii transfer mode.

Anyone have a suggestion on how to fix this? either by FTP'ing it correctly or by opening it and resaving it?



Andras Eliassen - Microsoft Certified Professional
I have just started a blog about vb.net, oracle, mysql tips etc.
http://www.EasyWebBasket.net
Welcome to visit and leave comments ;)


Regards,
Botzy

FTPGetFile For Pocket PC 2002
helo... i having problem in doing FTP... so do anyone can help me... the error code is Error 87 while running the FTP PutFile
The source code is from Microsoft website but i still having problem on it

FTPGetfile API Hangs/waits A Long Time To Release After Downloading Large Files
Does anyone know why ftpgetfile hangs and waits for a about a hour before it returns.. this error only occurs when I am downloading large file eg:>200mb..
I enumerate a folder get all files and the use ftpgetfile to get them all.. this part works but I will be dammed if I can figure out why on large files it hangs.. the FTP server I am using is MS 2003 sp1 it used to work..
I have done some testing and instead of using ftpgetfile I started using InternetReadFile() and that worked for large files but for some reason I cant get to to download all files in a directory only the first one and then it errors out :-(

any suggestion would be appreciated.

Help With Wildcards!
Can anyone tell me how to set wildcards (or something similar) up for text. I am currently trying to make the program see if "cmd" exists in any part of what they write in the text box. At the moment all it does is see if all thats in the text is cmd. I have searched for an answer everywhere and have only come across the use of "*", but I cannot apply it to text.

This is the if statment that I want to apply it to;

If txtSay.Text = "cmd" Then

Call funcCmdMenu

End If

Thanks in advance to anyone who helps with this problem.

Wildcards
I'm just wondering if there is any way to feed vb a wildcard, so that, for example, if I have:

Code:
sString = Replace(sBUDir, "C:", "D:")
I would be able to feed a wildcard in place of 'C' so that it would basically look like sString = Replace(strBUDir, "?:", "D:").

Wildcards
So far you input a source path and filename or path and *.* and my program will then make copies of that/those files to another location (also specified).

How it works is:

If filename = "*.*" Then
Loop Dir function to find all filenames and copy each file
Else
Copy the specified file
End If

What I want to do now is allow for copying all files of a specified extention.
E.g. *.mdb

Any Ideas how I could do this without specifying each extention as a seperate if statement?

Many thanks,

Nick

Wildcards
Hey guys

I am trying to get specific events out of the event log but I want only 1 day specifically. If I use the timewritten I need to put something so it does not check the time as well, some wildcard so I would have the time
20040209092908.000000+660 - includes time
20040209??????.000000+660 - need wildcard
How can I break this up to just be able to use the date???

Does anyone know how I can do this?

Const ForAppending = 8

Set objFSO = wscript.createobject("scripting.filesystemobject")
Set objTextFile = objFSO.OpenTextFile _
("eventviewer.txt", ForAppending, True)

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\" & strComputer & "
ootcimv2")
Set colEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent Where Logfile = 'System' and " & "timewritten = '20040209092908.000000+660'")
For Each objEvent In colEvents
objTextFile.WriteLine(objEvent.timewritten)
objTextFile.WriteLine(objEvent.message)
objTextFile.WriteLine
Next

Wscript.Echo "Event check finished!"

Wildcards
I am new and find this annoyingly hard.
I need to make it so that the command searches through the file in question and, choosing the items required from the file, puts their details into a list. I can only get it to aquire the exact same item of data from the file that matches the variable however. I want it to extract matching ones and ones including the variable text. I'm not overly bothered about casing right now, I can sort that out later. I figure I should be using the Like [required pattern] operator. Only I can't. Any help please?


Code:
Private Sub cmdSearch_Click()
FileVideo = App.Path & "Videos.txt"
SearchVar = txtSearchVar.Text
Open FileVideo For Random As #1 Len = Len(Video)
NumberofRecordsV = LOF(1) / Len(Video)
Searchcount = 0
For SearchIndex = 1 To NumberofRecordsV
Get #1, , Video
If Trim$(Video.VideoName) = SearchVar Then
lstRDisp.AddItem Video.VideoNo & " " & Video.VideoName & " " & Video.VideoPrice
Searchcount = Searchcount + 1
End If
Next SearchIndex
Close #1
If Searchcount = 0 Then
MsgBox ("Sorry, that film is not in the database.")
End If
End Sub

I'm not sure how to replace

Code:
Trim$(Video.VideoName) = SearchVar
with what it should be to wildcard the search.

Use Of WildCards
I have a string which i want to remove a section of
eg "abcdef123ghijk".

If for example I wanted to remove the "f123g" I can use the replace function and replace with "", however, these numbers will be changing.

Is there anyway to use wildcards and remove the string "f***g" where * is the wildcards.

Ive looked around with no success.


Cheers in advance.

Sql Wildcards In Vb
Hi, I have the following bit of code. Could anyone please tell me what the correct way is to use a wild card in this statement. Eventually I will replace the one with a reference to a string. Which may be blank (""). If this is the case I want it to find all records.

Me.rstCharacters.RecordSource = "SELECT FirstName, FamilyName FROM Character WHERE HouseReference = 1"

Thanks for your time.

Ben.

Ado Wildcards
Could someone tell why these are used.Moreso on ado as they have caused me trouble recently.If I have a statement like

Code:
strSql = "Select * From Tabel where field1 Like '" & lstfields.Text & "%'"
and I know that the field in my table will be Like the text selected in the listfields-why do I need wildcards.Are they a precaution or something?
thanks.

SQL Wildcards
Hey

Im trying to set an SQL with a wildcard after a dim name as below:

Dim TitleSearch
TitleSearch = InputBox("Enter Title")
strTitleSearch = "Select * from Book where Title contains('" & TitleSearch & "')"

As it is this only works if the title is EXACT. To get a wildcard I know you're supposed to enter a % (* for access im told). Where abouts does it go? Ive tried different combinations but it doesnt seem to stick. Is it true that theres a different character that is a % but not shift5?( chr 34????)

Help please!

Wildcards
How can i make it so like If Text1.text = *example* Then GoTo lala

so if text1.text equals 123example456 it would go to lala

Using Wildcards
Hi all, I have probably a very silly question but I cant figure it out. I can easily get wildcards to work with an SQL statement but I cant get the wildcards to work when searching through any other string. Here is what I want to do:

Code:
If ddnMultiSelect1.Selection = "*None" Then

This of course doesnt work...any suggestions would be great. Thanx everyone!

Wildcards
How would I search a listview using wildcards?
Example: /find Mary*
would search for Mary and anything that appears after the letters MARY. Or /find *ary searchs the listview for anything before ary. Same for a wildcard within the name ex: /find M*r* Or even /find *r* or /find *

Thanks

Wildcards
okay, i know for wildcards u use * and ? , but for some reason i cant get it to work.

I have a filename get sent to a label, here is the code (its really simple for now):


VB Code:
if form1.label5.caption = "Tom*.txt" thendialog.show 'simple test to show it workedend if



i also tried = "Tom*" & ".txt" but neither worked

can anyone help me out?

p.s. i also tried going directly from the variable ( if FILENAME = .....)

Sql And Wildcards
I want to build a sql string from a form. I have four dropdown boxes, if there is a selection in a box it gets put in the sql string.
Problem is if there is no selection then my string doesn't work.
to keep it simple lets stick to two pulldowns

Ex.
sql="select * from product where Foundby =" & PullDown1 & Product=" & PullDown2

If PullDown2 has no selection it should be a wildcard but the * doesn't seem to work.

Without building a bunch of if statements with different sql strings is there an approach I can take to still retrieve all data regardless of whether PullDown1 or PullDown2 has a entry.

Wildcards
Yes yes some people will tell me to search . But all I've found doing a search is for using databases. I was wondering how you would set it up.

Dim n As Integer
For n = 0 To 8
Dim stitles(8) As String
stitles(0) = "calculator"
Dim winHwnd As Long
Dim RetVal As Long
winHwnd = FindWindow(vbNullString, stitles(n))
Debug.Print winHwnd
If winHwnd <> 0 Then
RetVal = PostMessage(winHwnd, WM_CLOSE, 0&, 0&)
If RetVal = 0 Then
MsgBox "Error posting message."
End If
End If
Next

How could I set it up so that it could be calc* to kill any window that contains calc******** etc

Any help appreciated

Cheers

Andy

Wildcards
Can anyone tell me a similar way of doing this

echo įĪ≤Ř Copying Class Files ... Ř≤Īį
xcopy %SOURINTER%*.class %DESTINTER%*.class /s /v > NUL
if errorlevel 1 goto error

in VB????

Wildcards
Yes can someone help me
 I am just trying to make the value of one textbox (txtValue) have a 0 or 1 depending on whats in (txtLast). If the last name starts with "A" as in A-Z then (txtValue) should be 0. If it starts with any other letter I want the value to be 1. I have tried wildcards "*" and "%" and it always asigns 1 to the (txtValue). Can anyone help me understand what I am doing wrong.
Thanks

If UCase(txtLast.Text) = "A%" Like "[A-Z]" Then
        txtValue.Text = 0
    Else
        txtValue.Text = 1
    End If



Edited by - jmhshep on 12/4/2003 10:10:14 AM

Using Wildcards
Hi,

I have a word file that holds student information in a specific format.

<my_stud_name>Bob Dylan
<my_stud_age>60
<my_stud_dob>1-10-1945
<my_stud_add>12 abc def
<my_stud_objective>To be an artist and also to get a vba app runing properly

i have a multi-page document with more data like this. I want to convert this into an xml file with my tags specifications. (Using VBA or VB)

<xml_s_name>Bob Dylan</xml_s_name>
<xml_s_age>60</xml_s_age>
<xml_s_dob>1-10-1945</xml_s_dob>
<xml_s_add>12 abc def</xml_s_add>
<xml_s_objective>To be an artist and also to get a vba app runing properly</xml_s_objective>

i used a straight forward replacement function and was able to replace all the basic tags into my xml tags and now my current document looks like this

<xml_s_name>Bob Dylan
<xml_s_age>60
<xml_s_dob>1-10-1945
<xml_s_add>12 abc def

Then thought of using wildcards.

Since every statement ends with a carriage return and the next tag stats on the next line, it allows me to look for patterns and place my end tags also.

For example if i hit find and replace (choose to use wildcards) and then post

Find: <xml_s_name>(*)^13

It fetches all such instances. Now i have no idea of how to write a function for this. so that it takes the source
and replace it with source + destination.
so it looks like

<xml_s_name>Bob dylan</xml_s_name>

Hope You can Help!. If using wildcards is not a good idea, the please suggest an alternate solution

Thanks in advance.

PS: IF i am not clear...let me know and i'll put a better description    

Wildcards
Can anyone tell me a place where I can read up on how to use wildcards?

Thanks!

InStr() + Wildcards?
Quote:




If InStr(data, ":Deepy^!~iv07-12@192.121.39.50 PRIVMSG Deepy123 :VERSION") = 1 Then




I'm using that to see if the bot has gotten a "CTCP VERSION" on IRC, but the problem is... only the one connected as Deepy^ with the correct ident + ip can trigger it.
and wildcards didnt seem to work...
so my question is, how do i use wildcards to make this work? and can i somehow store the nickname/ip/ident of the user in a variable or not?

VBScript And Wildcards
Sorry... not sure if this goes here, but I'm having an issue with using wildcards in VBScript. I have an array and need to check if certain keywords show up then do action from there, but I keep getting my error msgbox when testing. Please help. Does search words need to be case sensitive? Here's the snippet below.


DELTRACK = SPLIT(DATA, "[EXTRACT]")
MSGBOX DATA
IF DELTRACK(0) = "*REJECT*" THEN
MSGBOX DELTRACK(0)
ELSEIF DELTRACK(2) = "????????" THEN
MSGBOX DELTRACK(2)
ELSEIF DELTRACK(1) = "*EXPEDITE*" THEN
MSGBOX DELTRACK(1)
ELSEIF DELTRACK(1) = "*SHIP*" THEN
MSGBOX DELTRACK(1)
ELSE
MSGBOX "ERROR"
END IF

WildCards And Filter
HI , i have this code and i need to filter it out.


Code:
Public Sub GetFile(Path As String, Optional Filter As String = "*.*")

Dim FS As FileSystemObject, F As File, Temp() As String, sName as string
Set FS = New FileSystemObject
Set FL = FS.GetFolder(Path)
For Each F In FL.Files
Temp = Split(F, "")
sName = Temp(Ubound(Temp))
' Need to filter it out here
' if file meets filter then
'List1.additem sName
'end if
Next
end Sub

Can any one help me

Searching With Wildcards
With ado and dao flitering a recordset only lets you use an * at the beginning and end or the end of a string. Is there any way to do more advanced searches with sql?

Wildcards With Instr
Is it possible to use wildcards with the instr

Code:
InStr(1, NumHldr, "B[aie]ll")
Or to use several comparison strings to search for?

Code:
InStr(1, NumHldr, "Ball" Or "Call")

If Elseif Wildcards
how do I get something to react if the textbox says anything but what I want it to? example:


Code:
if text1.text = "password" then form2.show
if text1.text = (anything but password) then text1.text = "wrong"

or maybe this would work better:

Code:
if text1.text = "password then form2.show
elseif text1.text = (anything but password) then text1.text = "wrong"
endif

I just need a wildcard type charature... I know theres gotta be an easier way than to build a database of if text1.text = "somewords" then text1.text = "wrong". that would take too much time and theres too many variables.

thanks

Specifying Image Wildcards
In this following code
If ((Image5(*).Left + Image5(*).Width + 40) <= 5670) Then
Image5(*).Left = Image5(*).Left + 40

How do i make every Image5 I have eg image5(0) image5(1) be moved in this code.

MS Access Wildcards And Vb6
Folks

I have the following query:


VB Code:
SELECT input.Title, input.FirstName, input.Surname, input.AddressLine1, input.AddressLine2, input.AddressLine3, input.Locality, input.Town, input.County, input.POSTCODEFROM input, tblRudeWHERE (((input.Title)=[tblrude].[rude])) OR (((input.FirstName) Like "*[tblrude].[rude]*")) OR (((input.Surname) Like "*[tblrude].[rude]*")) OR (((input.AddressLine1) Like "*[tblrude].[rude]*")) OR (((input.AddressLine2) Like "*[tblrude].[rude]*")) OR (((input.AddressLine3) Like "*[tblrude].[rude]*")) OR (((input.Locality) Like "*[tblrude].[rude]*")) OR (((input.Town) Like "*[tblrude].[rude]*")) OR (((input.County) Like "*[tblrude].[rude]*")) OR (((input.POSTCODE) Like "*[tblrude].[rude]*"));


Which should return records from table input where any of the fields listed contain any of the values from table tblrude.

If I use = instead of like then I do get matches, but only exact matches. I need to be able to find occurrences of the values of tblrude inside the values of table input. If that makes any sense!

eg. If one of the fields in table input is 'arse' and one of the fields in tblrude is 'arse' and I use = instead of like then I get a match however if the field in input is 'arsey' and I use like then I get no match.

I'm pretty sure it's something very simple but I can't quite put my finger on it.

Cheers

Wildcards...?[SOLVED]
Hi.I'm using this code with an inet :

VB Code:
Private Sub Command1_Click()Dim strURL As String, fst As StringDim a As Integer, b As IntegerstrURL = Inet1.OpenURL("http://wota.no-ip.com/ladder.html")a = InStr(5, strURL, "[b]1[/b] - [b]7575[/b] - ")b = InStr(5, strURL, " - [b]169[/b] - [b]66[/b]")fst = Mid(strURL, a + 11, b - (a + 11))Text1.Text = fstEnd Sub

That works but every 5 hours the bolded numbers might change...
So how can I put a wildcard so it wont matter if the numbers change...?
Thanks

P.S:I searched the forums and I found that you need to use the "like" command...How can I use this command...?

String Wildcards?
Hey! Is it possible to put some sort of wildcard for strings in an If
statement?

Like

VB Code:
If Text = "Something: " & vbWildCard 'If Text is "Something: " and anything else then  
?

Replace Using Wildcards
I'd like to run through a string and replace :

<A href="stuff">

with

<A href="stuff" Target="blank">

I want to do something like:

mystring=replace(mystring,"<A href*>",<A href* Target="blank">")

But of course that won't work.

Filecopy &amp; Wildcards ???
I have done this using the vb6 filesystemobject, but I am using vb5 & trying to copy everything within 1 folder to another. Is there a way to say:

filecopy "C:folder_1*.*", "C:folder_2*.*"

possibly some type of loop which copies every file in a path rather than you specify 1 file at a time?


Thank you everyone!

Wildcards Using FileSystemObject Or Whatever
Question: Creating app that will give me just the file name of any file in a specified directory with the extension .rar.

FSO doesn't seem to understand wildcards in VB. Is there a way to make it give me back just the file name? The File name will never be the same.

Wildcards In Vb And Access Using Sql
I wish for my vb program to search, through a list of people, for anindividual. The user will enter a couple of letters in a textbox andthen the program will go out and search a database for that individual.What I need to know is what is the wildcard, in a where clause, to findall matching individuals. For example, is it going to be a * or a # orsomething else. Maybe I am going about this the wrong way, couldsomeone offer me some ideas.

Charles Black
email@removed

Copyright © 2005-08 www.BigResource.com, All rights reserved