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 adds double quotes around a string for database insert and update
'****************************************************************** '* Value(s)passed: ..... '* Value(s)returned: ..... '* Date: 05-12-2002 '* Author: Ahmad E. Ashparie '* ___________________________________________ '* Modification Log '* Date Author Description '* ------ -------- ------------- '* '******************************************************************* Public Function InQuotes(strToPutInQuotes) 'this function will place double quotes around the string 'and returns this value to the caller Const StrQuote As String = "'" 'if string is null then return null If strToPutInQuotes = "NULL" Or strToPutInQuotes = "Null" Or strToPutInQuotes = "" Then InQuotes = StrQuote & strToPutInQuotes & StrQuote Else 'if not null then add "" around string InQuotes = StrQuote & strToPutInQuotes & StrQuote End If End Function Example: strInsert = "update andrs_db_reports" & _ " set list1= " & InQuotes(list1Text) & _ ", list2= " & InQuotes(list2Text) & _ " where report_id= " & (RecID)
HOME
|
ABOUT
|
CONTACT US
Copyright © 2009 ASP-VBCode