Click here to Skip to main content
15,881,852 members
Home / Discussions / Database
   

Database

 
GeneralRe: DataSet fill problems Pin
Dan Neilsen26-Sep-05 11:50
Dan Neilsen26-Sep-05 11:50 
QuestionAttaching database to SQL server Pin
Imtiaz Murtaza25-Sep-05 8:02
Imtiaz Murtaza25-Sep-05 8:02 
AnswerRe: Attaching database to SQL server Pin
Dave Kreskowiak25-Sep-05 16:49
mveDave Kreskowiak25-Sep-05 16:49 
QuestionChange Grid Colum order using Mouse Pin
Ammar Ben Hadj Amor25-Sep-05 1:47
professionalAmmar Ben Hadj Amor25-Sep-05 1:47 
AnswerRe: Change Grid Colum order using Mouse Pin
miah alom25-Sep-05 7:09
miah alom25-Sep-05 7:09 
QuestionCRYSTAL REPORTS AND JOIN SQL Pin
Member 120841225-Sep-05 1:20
Member 120841225-Sep-05 1:20 
QuestionHow to Create DSN by APIs? Pin
shoaibnawaz24-Sep-05 11:02
shoaibnawaz24-Sep-05 11:02 
AnswerRe: How to Create DSN by APIs? Pin
miah alom25-Sep-05 7:06
miah alom25-Sep-05 7:06 
You need to call methods on ODBCCP32.dll

SQLConfigDataSource

Option Explicit


Private Const ODBC_ADD_DSN = 1 ' Add data source
Private Const ODBC_CONFIG_DSN = 2 ' Configure (edit) data source
Private Const ODBC_REMOVE_DSN = 3 ' Remove data source
Private Const ODBC_ADD_SYS_DSN = 4 ' Add a new system data source.


'ODBC_CONFIG_SYS_DSN: Modify an existing system data source.

'ODBC_REMOVE_SYS_DSN: Remove an existing system data source

Private Const vbAPINull As Long = 0& ' NULL Pointer



Private Declare Function SQLConfigDataSource Lib "ODBCCP32.DLL" (ByVal hwndParent As Long, ByVal fRequest As Long, ByVal lpszDriver As String, ByVal lpszAttributes As String) As Long

Public Function AddODBCDSN()

Dim strDriver As String
Dim strAttributes As String
Dim intRet As Long

'since i do not have SQL Server installed....
strDriver = "Microsoft Access Driver (*.mdb)" 'Set the attributes delimited by null.
'See driver documentation for a complete
'list of supported attributes.

'You should use this
'strDriver = "SQL Server"
strAttributes = "SERVER=SomeServer" & Chr$(0)
strAttributes = strAttributes & "DESCRIPTION=Test DSN" & Chr$(0)
strAttributes = strAttributes & "DSN=DSN_TEMP" & Chr$(0)
strAttributes = strAttributes & "DATABASE=c:\test.mdb" & Chr$(0)
'strAttributes = strAttributes & "UID=" & Chr$(0)
'strAttributes = strAttributes & "PWD=" & Chr$(0)

'To show dialog, use Form1.Hwnd instead of vbAPINull.
intRet = SQLConfigDataSource(vbAPINull, ODBC_ADD_SYS_DSN, strDriver, strAttributes)
If intRet Then
MsgBox "DSN Created"
Else
MsgBox "Create Failed"

End If
End Function

QuestionMax(NumberFieldName) in SQL Server Pin
shoaibnawaz24-Sep-05 10:59
shoaibnawaz24-Sep-05 10:59 
AnswerRe: Max(NumberFieldName) in SQL Server Pin
Luis Alonso Ramos24-Sep-05 11:38
Luis Alonso Ramos24-Sep-05 11:38 
Questionconvert interbase database file into sql server database Pin
briju24-Sep-05 0:04
briju24-Sep-05 0:04 
QuestionFormatted emails from SQL Server Pin
Member 230181723-Sep-05 20:59
Member 230181723-Sep-05 20:59 
Questioncreate/update tbl in MS Access Pin
rmarma23-Sep-05 10:17
rmarma23-Sep-05 10:17 
AnswerRe: create/update tbl in MS Access Pin
rmarma23-Sep-05 10:18
rmarma23-Sep-05 10:18 
AnswerRe: create/update tbl in MS Access Pin
Yulianto.23-Sep-05 17:42
Yulianto.23-Sep-05 17:42 
GeneralRe: create/update tbl in MS Access Pin
rmarma25-Sep-05 23:06
rmarma25-Sep-05 23:06 
Questionhow can i have the record number in query Pin
m.rastgar23-Sep-05 7:14
m.rastgar23-Sep-05 7:14 
AnswerRe: how can i have the record number in query Pin
Michael Potter23-Sep-05 7:36
Michael Potter23-Sep-05 7:36 
QuestionADO.NET DataBinding ComboBox Pin
Kotolom23-Sep-05 2:54
Kotolom23-Sep-05 2:54 
QuestionTake Backup of Database Pin
imshally8123-Sep-05 1:37
imshally8123-Sep-05 1:37 
AnswerRe: Take Backup of Database Pin
enjoycrack23-Sep-05 2:10
enjoycrack23-Sep-05 2:10 
Questionenable TCP\IP protocols for SQL server Pin
Prafulgoyal23-Sep-05 0:31
Prafulgoyal23-Sep-05 0:31 
QuestionesT-Sql Problem Pin
WDI22-Sep-05 23:49
WDI22-Sep-05 23:49 
AnswerRe: esT-Sql Problem Pin
miah alom23-Sep-05 3:32
miah alom23-Sep-05 3:32 
GeneralRe: esT-Sql Problem Pin
WDI23-Sep-05 3:38
WDI23-Sep-05 3:38 

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.