Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error using the function GMW_LoadBDE

Status
Not open for further replies.

RedLion

Programmer
Sep 13, 2000
342
NL
Hello,

I try to connect to a MS SQL database using the GM5S32.dll. I have set up an BDE allias called "REL" wich connects to a ODBC connection I have set up to connect to a MS SQL database called "GoldMineRelations".

I get an error return code when callig GMW_LoadBDE with the value -8, and this code is not documented in the help of goldmine.....

All my tables except of the license information is located in the same database called "GoldMineRelations". In other threads I see that everyone has two different locations specified, could this be a problem for me? Should the BDE alias be specified in the LoadBDE function or the ODBC alias?

Any other suggestions, of what the problem could be?

(it's Visual FoxPro code)
Code:
* connecting functions
DECLARE integer GMW_LoadBDE IN (cPath + "\GM5S32.dll") string, string, string, string, string
DECLARE integer GMW_UnloadBDE IN (cPath + "\GM5S32.dll")
DECLARE integer GMW_SetSQLUserPass IN (cPath + "\GM5S32.dll") string, string

* mutation functions
DECLARE long GMW_DB_Open IN (cPath + "\GM5S32.dll") string
DECLARE long GMW_DB_Append IN (cPath + "\GM5S32.dll") long, string
DECLARE long GMW_DB_Replace IN (cPath + "\GM5S32.dll") long, string, string, integer
DECLARE long GMW_DB_Close IN (cPath + "\GM5S32.dll") long
CLEAR

? GMW_SetSQLUserPass("sa", "saPassword")
? GMW_LoadBDE(cPath, "MSSQL: REL: DBO", "MSSQL: REL: DBO", "CHARL", "CHARLPassword")

lwOpmgr = GMW_DB_Open("OPMGR")
? lwOpmgr
IF (lwOpmgr > 0)
	lcId = SPACE(20)
	? gmw_db_append(lwOpmgr, @lcId)
	? lcId
	? gmw_db_replace(lwOpmgr, "name", "TEST_CHARL", 0)
	? gmw_db_replace(lwOpmgr, "opid", lcid, 0)
	? gmw_db_close(lwOpmgr)
ENDIF
? GMW_UnloadBDE()
CLEAR DLLS


BTW I've been arround on Tek-Tips for a while now almost 5 years, but it suprises me every day how much information to find on the forum, to even find GoldMine information.....great job!

Thanks inadvance,

Charl
 
Charl,

Should have : after DBO

Here is a list of all of the LoadBDE return codes:

1 -- success
-1 -- BDE failed to load
-2 -- Cannot find license file
-3 -- Cannot load license file
-4 -- Failed to validate password
-5 -- Invalid GoldDir
-6 -- Invalid CommonDir
-7 -- Failed to allocate the needed TLS slot
-8 -- General failure
-9 -- No access to files for this user

Added in 6.7:
-10 -- No SQL credentials


So I'd make sure your BDE Alias is setup correctly.


Regards,

Richard.
PRIOR Analytics UK
Winners of the LBA Customer Service Award.
 
I saw I haven't give you a response yet, but thanks for the list of return codes, it helped me a little bit where to look.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top