GetSchema VB Subroutine

by Bill Dowling 30. July 2010 13:56
This VB Subroutine, gets Schema information (Column Name, Type, Size) from an Access DB Table. Private m_connDB As OleDbConnection = Nothing ' Current DB Connection Private m_sSchemaTable(1, 2) As String ' Table Schema Info Private Enum eSchemaFields As Integer ColumnName = 0 ColumnSize = 1 D... [More]

Tags:

.Net Coding Examples | Access DB

CellFormat VB Function

by Bill Dowling 29. July 2010 12:04
This code is used to call the CellFormat function to get a single Excel Cell '****************************** ' Open up the Excel Application '****************************** Dim xlApp As New Excel.Application xlApp.Visible = False xlApp.UserControl = False '****************** ' Open the workbook '****************** Dim xlWb As Excel.Workbo... [More]

Tags:

.Net Coding Examples | Excel

PrintHelper VB Class

by Bill Dowling 29. July 2010 09:33
Printing in a .Net (or any VB) program has always been a challenge. I developed the following VB.Net Class (with guidance from others) to help simplify the printing process. The class can be created with; Dim ph As New PrintHelper(_event, _font, _debug) _event As System.Drawing.Printing.PrintPageEventArgs From the Event Handler _f... [More]

Tags:

.Net Coding Examples

ufs_URLSite Scalar-Valued Function

by Bill Dowling 29. July 2010 08:22
Returns Web Site name from a URL line. USE [DB_Name] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE FUNCTION [dbo].[ufs_URLSite] ( @URL varchar(2000) ) RETURNS varchar(255) AS BEGIN DECLARE @Result varchar(2000), @SearchFirst varchar(100), @SearchNext varchar(100), @Pos int S... [More]

Tags:

SQL Coding Examples

ufs_URLEncode Scalar-Valued Function

by Bill Dowling 29. July 2010 08:14
Returns encoded URL line. For example, all spaces are replaced with %20. USE [DB_Name] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE FUNCTION [dbo].[ufs_URLEncode](@url varchar(1024)) RETURNS varchar(3072) AS BEGIN -- Peter DeBetta's SQL Programming Blog -- http://sqlblog.com/blogs/peter_debetta/archive/2007/03/09/t... [More]

Tags:

SQL Coding Examples

ufs_URLDecode Scalar-Valued Function

by Bill Dowling 29. July 2010 08:10
Returns decoded URL line. For example, %20 is replaced with a space. USE [DB_Name] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE Function [dbo].[ufs_URLDecode](@url varchar(3072)) RETURNS varchar(3072) AS BEGIN -- Peter DeBetta's SQL Programming Blog -- http://sqlblog.com/blogs/peter_debetta/archive/2007/03/09/t-... [More]

Tags:

SQL Coding Examples

uft_ReadFileAsTable Table-Valued Function

by Bill Dowling 28. July 2010 07:17
Returns a table with each line from the text file written to a row in the table. USE [DB_Name] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE FUNCTION [dbo].[uft_ReadFileAsTable] ( @Path VARCHAR(255), -- Folder containing file @Filename VARCHAR(100), -- FileName to read @MaxLin... [More]

Tags:

SQL Coding Examples

uft_ParseString Table-Valued Function

by Bill Dowling 28. July 2010 07:13
Returns a table with parsed elements (words) in a passed string. USE [DB_Name] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE FUNCTION [dbo].[uft_ParseString] ( @linetoparse VARCHAR(2000), @delimeter CHAR(1) ) RETURNS @elements TABLE ( ElementID INT IDENTITY (1,1), Element VARCHAR(2000) ) AS Begin ... [More]

Tags:

SQL Coding Examples

usp_DirFolder Stored Procedure

by Bill Dowling 28. July 2010 06:58
Returns the filenames contained in the passed Folder name. USE [DB_Name] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[usp_DirFolder] @PCWrite varchar(2000), -- The first parameter is a path to a directory @DBTable varchar(100)= NULL, -- The second parameter is a table name in which to inser... [More]

Tags:

SQL Coding Examples

SQLdbCopy Tech Info

by Bill Dowling 28. July 2010 06:19
Different SQL Server statements need to be performed depending on what version of SQL Server you are running. Below are some of the statements used in SQLdbCopy to perform specific tasks, both for SQL Server and Visual Basic with Visual Studio 2005 and 2010.   Sql Server 2000 Version 8 Sql Server 2005 Version 9 Sql Server 2008 Version 1... [More]

Tags: , ,

Access DB | SQL Coding Examples

About the author

Bill Dowling has been a VB and .Net programmer for as long as he can remember.

Month List