devxlogo

We are an award-winning tech entrepreneurship website where trusted experts can provide value globally.

Since 1998, DevX has helped people start businesses, build websites, and provide enterprise technology to people globally. Interviewing the likes of Microsoft’s co-founder, Steve Ballmer, the publication brings comprehensive, reliable, and accessible insights to the Internet.

devxlogo

Trusted for 26 years

Over 30K Articles

1M+ Readers

Expert-reviewed

10K+ Tech Terms

As seen in:

microsoft logo
business_insider_logo
wired_logo
berkley
arstechnica_logo
hackernoon

The Latest

The beginning or end of previous week

For reporting, many times you need to figure out what date last week began and ended. Use the code below to figure that out: Dim vntBegin As variantDim vntEnd As

Send HTML Email via CDO

Ever wonder how to send email that looks like a web page? Here is how you do it. Note: You must have CDO for NT referenced for this to work.

Sending Email Using CDO and MAPI

Sending emails via code used to be cool, but now it is a necessity. Below is code to send email via CDO. If the CDO call fails, it will send

IsValidDateField – Check whether a date is valid

Enum psDateTypes AnyValidDate ‘Allows any valid date to be entered PastDate ‘Only allows past dates (before today) to be entered FutureDate ‘Only allows future dates (after today) to be entered

IsValidSSN – Check a Social Security Number value

‘ Validates attributes of the SSN’ Returns True if valid, False if invalid”Example:’ If IsValidSSN(Value:=”333-44-3333″, IsRequired:=True) then …Function IsValidSSN(ByRef Value As String, Optional ByVal IsRequired As Boolean _ = True)

Create Database Primary Keys on the Fly

Since Guids are unique anywhere you find them, they make a good primary key.The trick is to create them where and when you need them using the CoCreateGuidAPI. You can

Precedence of the * and []Operators

The array subscript operator, [], has a higher precedence than the pointer dereference operator, *. Therefore, the following snippet declares an array of 10 pointers to char, not a pointer

Creating and Executing a Variable as a Query

Question: How do I create a stored procedure that will construct and execute a query from its parameters? At the heart I’d imagine something like this, for simplicity’s sake: declare

Date Time Fields

Question: I have a database with a DateTime field of the following structure 1974-01-18T00:00:00′. How do I query it so that I can extract the dates with a particular day

Large Text Fields

Question: How do I create a text field of greater than 8,000 characters (in v7.0)? I attempted to use the “text” data type, but my code returned an error saying

Storing RTF Text

Question: I’m trying to store text that’s in an RTF format using the TextRTF property of VB’s RichTextBox control. What type of field do I have to use in my

Rolling 12-Month Totals

Question: I have two similar tables with monthly data: one holds current year data and the other holds prior year data. How do I combine them to create a rolling

Converting Number to Date

Question: How do I convert a number that represents a date into a date field? The number’s format is CCYYMMDD. Answer: Fortunately, the format of your numeric value doesn’t need

CopyURLToFile – Download a file from the Internet via FTP or HTTP

Const INTERNET_OPEN_TYPE_PRECONFIG = 0Const INTERNET_FLAG_EXISTING_CONNECT = &H20000000Private Declare Function InternetOpen Lib “wininet.dll” Alias “InternetOpenA” _ (ByVal lpszAgent As String, ByVal dwAccessType As Long, _ ByVal lpszProxyName As String, ByVal lpszProxyBypass

Auto Start Full Text Index

Question: Can I auto start full text index? Answer: Although Enterprise Manager doesn’t provide the option, you can set this service to start automatically by using the services icon in

Determining Field Data Type

Question: Is there a non-platform-specific SQL way of determining what data type a given field is? Answer: That information is specific to each database. Every product stores its meta data

User-Defined Data Type in a Temporary Table

Question: Can I use a user-defined data type when defining a temporary table in a stored procedure? Answer: You can use user-defined data types in temporary tables, but remember one

Renaming a File

To rename a file, use the standard function rename() (declared in ). This function takes two arguments of type const char *, the first of which is the old name

Deleting a File

The standard function remove() deletes a file. It takes one argument of type const char * which is the name of the file to be deleted. You can provide a

Understanding Iterator Categories

The Standard Template Library defines five major categories of iterators. The following diagram illustrates these categories:input iterators output iterators / forward iterators | bidirectional iterators | random access iteratorsNote that

Obtaining the Max Value from an Array

Question: How can I make a function to return and display the maximum number in the following array: int my_array[]={10,3,35,101,65,100}; Answer: First, sort the array. Then display the last element

New & Malloc

Question: I understand that most of the time, new and malloc may use the same allocation routines, but does that necessarily mean new calls malloc? I am asking because I

Sorting a Vector

Question: I have data in a Vector and need to sort it before displaying iton the screen; how do I do this? Answer: The Java 2 Collections Framework provides a

Superclass Variables Referencing Subclasses

Question: What is the advantage of declaring a variable as a superclass referenceand then pointing that variable to an instance of a subclass? Theway I see it, I can achieve

RMIC and Inner Classes

Question: Can RMIC make stubs for inner classes? When I tryrmic packagename.OuterClassName$InnerClassName, it doesn’t work. Answer: Yes, RMIC can make stubs for inner classes. However, you must use thefully qualified

Debugging in Visual C++

Question: Is there a way to access the call stack debugging information from the code? I would like to print the call stack inside a function, each time it is

Repair, Compact, and Back Up Access MDB

This repair and compact also backs up the Access MDB. Function ValidateMdb(MDB As String) As Boolean This function repairs, compacts, and backs up a database fileand deletes stray LDB (locking

Using Temp Tables in Oracle 8i

Oracle 8i introduces the concept of temp tables. This feature long since enjoyed by SQL Server developers enables data to be visible on a Session orTransaction basis. To create an