Hi,
I'm using VijeoCitect v7.1 with a local database Microsoft SQL Express. I make requests to that database using the PLUSADOCon.dll functions.
Here is the code that I use:
It works fine most of the time but sometimes I get this error from SQL Server :"Cannot open database "mydatabasename" requested by the login. The login failed".
Anyone can help me?
Thanks
Marie
I'm using VijeoCitect v7.1 with a local database Microsoft SQL Express. I make requests to that database using the PLUSADOCon.dll functions.
Here is the code that I use:
Code:
GLOBAL STRING Neptune_Connexion = "driver={sql server};SERVER=DELLVMXP\SQLEXPRESS;Database=mydatabasename;UID=sa; PWD=mypassword;Trusted_Connection=no;";
STRING sCommande;
INT hData;
sCommande = "SELECT EXCLEUNIK FROM Bal_Exp WHERE EnTraitement = '1'";
hData = PLUSADOExecute(Neptune_Connexion, sCommande);
IF (hData < 1) THEN
My_MessageBox("VerifExp - Erreur - " + IntToStr(hData),0, StrLeft(PLUSADOGetExecuteError(0),120),StrMid(PLUSADOGetExecuteError(0),120,120),"");
ELSE
Exp_CleOrdre = PLUSADOGetFieldText(hData,PLUSADOGetFieldIndex(hData, "EXCLEUNIK"),"");
END
PLUSADOClose(hData);
IF Exp_CleOrdre <> "" THEN
GetExp();
END
Anyone can help me?
Thanks
Marie