Click here to Skip to main content
15,900,724 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Crystel Report Style Pin
PapPatel13-Jul-06 8:40
PapPatel13-Jul-06 8:40 
QuestionOutLook in vb.net Pin
microuser_200010-Jul-06 23:48
microuser_200010-Jul-06 23:48 
AnswerRe: OutLook in vb.net Pin
KreativeKai14-Jul-06 2:05
professionalKreativeKai14-Jul-06 2:05 
QuestionHow to replace null(00) character instead of space(20)? Pin
eddie.jiang.tw10-Jul-06 23:36
eddie.jiang.tw10-Jul-06 23:36 
AnswerRe: How to replace null(00) character instead of space(20)? Pin
Guffa10-Jul-06 23:47
Guffa10-Jul-06 23:47 
GeneralRe: How to replace null(00) character instead of space(20)? Pin
Christian Graus11-Jul-06 1:21
protectorChristian Graus11-Jul-06 1:21 
GeneralRe: How to replace null(00) character instead of space(20)? Pin
eddie.jiang.tw11-Jul-06 22:40
eddie.jiang.tw11-Jul-06 22:40 
Questionthis is how u have to create ODBC , DSN using vb script Pin
Member 227165510-Jul-06 22:34
Member 227165510-Jul-06 22:34 
'Values for variables on lines 25 - 29, 32, and 36
'must be set prior to running this script.

On Error Resume Next

Dim RegObj
Dim SysEnv

Set RegObj = WScript.CreateObject("WScript.Shell")

'***** Specify the DSN parameters *****

DataSourceName = "Name_of_Connection"
DatabaseName = "Name_of_DB"
Description = "Description of connection"
LastUser = "Default_Username"
Server = "Put_server_name_here"

'if you use SQL Server the driver name would be "SQL Server"
DriverName = "SQL Server"

'Set this to True if Windows Authentication is used
'else set to False or comment out
WindowsAuthentication = True

'point to DSN in registry
REG_KEY_PATH = "HKLM\SOFTWARE\ODBC\ODBC.INI\" & DataSourceName

' Open the DSN key and check for Server entry
lResult = RegObj.RegRead (REG_KEY_PATH & "\Server")

'if lResult is nothing, DSN does not exist; create it
if lResult = "" then

'get os version through WSCript Enviroment object
Set SysEnv = RegObj.Environment("SYSTEM")
OSVer = UCase(SysEnv("OS"))

'check which os is running so correct driver path can be set
Select Case OSVer
Case "WINDOWS_NT"
DrvrPath = "C:\WinNT\System32"
Case Else
DrvrPath = "C:\Windows\System"
End Select

'create entries in registry
RegObj.RegWrite REG_KEY_PATH & "\DataBase",DatabaseName,"REG_SZ"
RegObj.RegWrite REG_KEY_PATH & "\Description",Description,"REG_SZ"
RegObj.RegWrite REG_KEY_PATH & "\LastUser",LastUser,"REG_SZ"
RegObj.RegWrite REG_KEY_PATH & "\Server",Server,"REG_SZ"
RegObj.RegWrite REG_KEY_PATH & "\Driver",DrvrPath,"REG_SZ"

'if WindowsAuthentication set to True,
'a trusted connection entry is added to registry
'else, SQL Authentication is used.
if WindowsAuthentication = True then
RegObj.RegWrite REG_KEY_PATH & "\Trusted_Connection","Yes","REG_SZ"
end if

'point to data sources key
REG_KEY_PATH = "HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources\" &
DataSourceName

'and add the name of the new dsn and the driver to use with it
RegObj.RegWrite REG_KEY_PATH,DriverName,"REG_SZ"

MsgBox DataSourceName & " DSN Created!"

else
MsgBox DataSourceName & " DSN already exists!"
end if

Set RegObj = Nothing
Set SysEnv = Nothing



QuestionExport to WOrd Pin
Socheat.Net10-Jul-06 22:02
Socheat.Net10-Jul-06 22:02 
AnswerRe: Export to WOrd Pin
Member 227165511-Jul-06 1:02
Member 227165511-Jul-06 1:02 
QuestionRichTextBox Pin
Socheat.Net10-Jul-06 22:00
Socheat.Net10-Jul-06 22:00 
Questionword document in web application Pin
Manik Nath10-Jul-06 20:42
Manik Nath10-Jul-06 20:42 
AnswerRe: word document in web application Pin
Rizwan Bashir10-Jul-06 22:52
Rizwan Bashir10-Jul-06 22:52 
GeneralRe: word document in web application Pin
Manik Nath10-Jul-06 23:49
Manik Nath10-Jul-06 23:49 
GeneralRe: word document in web application Pin
Member 227165511-Jul-06 0:18
Member 227165511-Jul-06 0:18 
AnswerRe: word document in web application Pin
hemrk11-Jul-06 11:21
hemrk11-Jul-06 11:21 
QuestionConvert string to date?? Help??? Pin
Nathan Buckley10-Jul-06 20:32
Nathan Buckley10-Jul-06 20:32 
AnswerRe: Convert string to date?? Help??? Pin
Guffa10-Jul-06 23:48
Guffa10-Jul-06 23:48 
AnswerRe: Convert string to date?? Help??? Pin
paragyerawar11-Jul-06 0:07
paragyerawar11-Jul-06 0:07 
AnswerRe: Convert string to date?? Help??? Pin
<b<font color="#6EA3C4">MILAN@Cybage11-Jul-06 1:03
<b<font color="#6EA3C4">MILAN@Cybage11-Jul-06 1:03 
GeneralRe: Convert string to date?? Help??? Pin
Nathan Buckley11-Jul-06 13:43
Nathan Buckley11-Jul-06 13:43 
Questionauto upload/export of a downloaded CSV file to SQLSERVER on the server [modified] Pin
amitcoder8310-Jul-06 19:47
amitcoder8310-Jul-06 19:47 
QuestionForms Pin
K71810-Jul-06 16:23
K71810-Jul-06 16:23 
AnswerRe: Forms Pin
Dave Kreskowiak11-Jul-06 4:22
mveDave Kreskowiak11-Jul-06 4:22 
GeneralRe: Forms Pin
K71811-Jul-06 14:59
K71811-Jul-06 14:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.