Hi , I work with VBA in visio , and i conected to my Instance in sql sever 2005
,and now i want execute Select query and get the result of this query from one of my table.
i dont know how can i retrive the result of this qury without datatabel, database , and qureyDef
i cant define DAO.Database , QueryDef ,...
i use below code to conect database
Const DB_CONNECT_STRING = "Provider=SQLOLEDB.1;Data Source=unicorn-pc\mssqlserver2005;Initial Catalog=EEPDC;user id ='sa';password='12345'"
Set MyConn = CreateObject("ADODB.Connection")
Set myCommand = CreateObject("ADODB.Command")
MyConn.Open DB_CONNECT_STRING
Set myCommand.ActiveConnection = MyConn
myCommand.CommandText = "select RevisionID from dbo.Revision where ObjectID_FK=1 "
myCommand.Execute
MyConn.Close