Accessing SQL Database in VBA using ODBC driver

1 Posts
1 Users
0 Likes
16 Views
LM
 LM
(@l-micaudarcinfo-com)
Posts: 383
Member Admin
Topic starter
 

One of our customer has found this issue recently.
It used to work before with PcVue 8.2 SP2 under Windows Server 2003.
His VBA sripts did request the database using stored procedure and the script looked like that:

cmd1.CommandType = adCmdStoredProc
cmd1.CommandText = "PieceExtCellule"

cmd1.Parameters(1).Value = branche

With a recent computer (Windows 8.1 Pro), PcVue version 11.2 and a recent ODBC driver it sometimes triggers an error on the red line.

The customer find a workaround by not using a stored procedure type of command but text type instead. Here is the modified script:

cmd1.CommandType = adCmdText
cmd1.CommandText = "PieceExtCellule '" & branche & "'"

This way is working and he doesn't have any trouble for a long period of time.

 
Posted : 02/12/2016 3:44 pm