Create A Connection String For Shapes in SQL Server

Search

 by Remas Wojciechowski

This function returns a standard connection string for creating shapes in SQL Server.

Parameters

strIP
The URI of the database server
strDB
The name of the database
strUser
The User ID
strPwd
The Password

Source Code

' ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++
' Function: db_SHAPE_SQLServer
'
'
Function db_SHAPE_SQLServer(ByVal strIP, ByVal strDB, ByVal strUser, ByVal strPwd)
  Dim strTemp
  Dim strPattern
  strPattern = "Provider=MSDataShape; Data Provider=SQLOLEDB; Server=%1; Database=%2; User ID=%3; Password=%4"
  strTemp = Replace(strPattern, "%1", strIP)
  strTemp = Replace(strTemp, "%2", strDB)
  strTemp = Replace(strTemp, "%3", strUser)
  strTemp = Replace(strTemp, "%4", strPwd)
  db_SHAPE_SQLServer = strTemp
End Function