Visual Basic 6 Code
Functions/Procedures
InQuotes Function
PauseTime Proc.
Remove Invld Chr Function
Database Insert Proc.
Database Select Function
Database Delete Proc.
Database Update Function
Make Enter key to act as TAB
Time calculation
Change 1st char to Ucase
Populate MSFlxGrid with db data
How to use CASE
Save file
Open file
Populate TreeView w/database
Catch RDO Error
This function removes unwanted char from a string
'****************************************************************** '* Value(s)passed: ..... '* Value(s)returned: ..... '* Date: 05-12-2002 '* Author: Ahmad E. Ashparie '* ___________________________________________ '* Modification Log '* Date Author Description '* ------ -------- ------------- '* '******************************************************************* Public Function RemoveInvldChr(ChrToRemove As String) Dim CharToConvert() As String Dim LenghtASC As Long Dim count As Long Dim NewCount As Long Dim New_password As String New_password = "" If ChrToRemove <> "NULL" And ChrToRemove <> "" Then 'set counter to the lenght of string ChrToRemove = Replace(ChrToRemove, Chr(34), " ") ChrToRemove = Replace(ChrToRemove, "/", " ") ChrToRemove = Replace(ChrToRemove, "'", " ") For count = 1 To Len(ChrToRemove) ReDim Preserve CharToConvert(count) ' Resize to 15 elements. 'check every chr CharToConvert(count) = Mid$(ChrToRemove, count, 1) 'remove chr such as return, backspace, new line and tab If CharToConvert(count) = Chr(13) Or _ CharToConvert(count) = Chr(8) Or _ CharToConvert(count) = Chr(9) Or _ CharToConvert(count) = Chr(10) Then CharToConvert(count) = " " End If 'after changing chr, add them all to reconstruct the original string RemoveInvldChr = (RemoveInvldChr) + (CharToConvert(count)) Next count 'if string empty, change it to NULL If RemoveInvldChr = "" Then RemoveInvldChr = "NULL" End If End If End Function
-
HOME
|
ABOUT
|
CONTACT US
Copyright © 2009 ASP-VBCode