Project 2003 and SQL Server 2000

P

pasvorto

I have a user with a project that needs to pull data (real time) from a SQL
Server 2000 database. Can anyone point me in the right direction? I assume I
need to use VBA. I am comfortable doing this in VB6, but have not tried it in
VBA.
 
D

Dana Brash

Project Standard or Pro?

What type of data are they looking to pull? You can use an ODBC connection
to save the entire project into SQL Server, or import data into a project.

If you want to update the project with data from SQL, how about saving the
project to SQL Server, then setting triggers on the appropriate tables to
update the information in the project's tables? You'll want to make sure
your trigger looks for locks before updating of course.

Perhaps this is too much of a 'push' approach? If so, I'd recommend writing
the macro you refer to.


--
HTH,
=d=


Dana Brash
MCSE, MCDBA, MCSA

(e-mail address removed)
 
P

pasvorto

What I was hoping for was something like:

1) add these references....
2) In the VBA:
CnxnTechSQL.Provider = "SQLOLEDB"
CnxnTechSQL.Properties("Data Source").Value = "Primero"
CnxnTechSQL.Properties("Initial Catalog").Value = "Techni"
CnxnTechSQL.Properties("Integrated Security").Value = "SSPI"
CnxnTechSQL.Open

then

'===============================
Set rsJob = New ADODB.Recordset
'===============================
sql = "SELECT * FROM JOB WHERE [JOBNUMBER] = " & some variable
rsJob.Open sql, CnxnTechSQL, adOpenKeyset, adLockReadOnly, adCmdText
If Not rsJob.BOF And Not rsJob.EOF Then
rsJob.MoveFirst
get data and put is somewhere in project
endif
rsJob.close
Set rsJob Nothing

CnxnTechSql.close
set CnxnTechSql = nothing

==That is kind of what I am hoping to accomplish. Is that sort of thing
possible?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top