Information générale
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
SQLConfigDataSource not working as it should
Hi
I am using VBA to create a system DSN entry.
The code creates the description, the database name, etc , but will not create
the server name
here is the code
********************************************************************
#If Win32 Then
Dim intRet As Long
#Else
Dim intRet As Integer
#End If
Dim strDriver As String
Dim strAttributes As String
'Set the driver to SQL Server because it is most common.
strDriver = "Sybase System 11"
'Set the attributes delimited by null.
'See driver documentation for a complete
'list of supported attributes.
strAttributes = strAttributes & "DESCRIPTION=" & lcDnsToCreate & Chr$(0)
strAttributes = strAttributes & "DSN=fred" & Chr$(0)
strAttributes = strAttributes & "SERVER=" & lcDnsToCreate & Chr$(0)
strAttributes = strAttributes & "DATABASE=" & Chr$(0)
'To show dialog, use Form1.Hwnd instead of vbAPINull.
intRet = SQLConfigDataSource(vbAPINull, ODBC_ADD__SYS_DSN, _
strDriver, strAttributes)
**********************************************************************
Has anyone came across this before, and found a solution to the problem ?
Hope you can help
Regards
Steven Bowskill
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement