Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
Scripting Languages / Re: ScriptBasic Windows 64 Bit
« Last post by John on August 21, 2021, 10:44:54 pm »
Please don't give up on SB.

The work you did on the SB 64 ODBC extension module worked. (PSQL64)

I'll figure it out, just frustrated at the moment.

I'm going to try it on my older test laptop that is pretty much virgin Windows 10 Pro.
22
Scripting Languages / Re: ScriptBasic Windows 64 Bit
« Last post by AIR on August 21, 2021, 10:38:47 pm »
This is the second time in this thread that you've 'given up'.

You're choice to stay on 32bit, but I'm done.  Moving on to a better language.....
23
Scripting Languages / Re: ScriptBasic Windows 64 Bit
« Last post by John on August 21, 2021, 10:02:12 pm »
It seems I had a couple versions of MS SQL Server installed. I uninstalled everything and reinstall Express. I still can't get a 64 bit ODBC driver configured without errors. The 32 bit driver configure works without issue.

I give up. I can't get a MS SQL Server 64 bit ODBC driver to configure.

The 32 bit setup works without any problems.
24
Scripting Languages / Re: ScriptBasic Windows 64 Bit
« Last post by AIR on August 21, 2021, 09:32:53 pm »
The standard 64bit SQL Server driver that comes with Windows 10.


25
Scripting Languages / Re: ScriptBasic Windows 64 Bit
« Last post by John on August 21, 2021, 07:43:39 pm »
I can't get any of the 3 MS SQL ODBC drivers to configure without blowing up in the ODBC 64 bit configuration when try test connection.

What ODBC driver did you use to connect to MS SQL Express?

I download the 64 bit MS ODBC driver version 17. Same problem


Microsoft ODBC Driver for SQL Server Version 17.08.0001

Running connectivity tests...

Attempting connection
[Microsoft][ODBC Driver 17 for SQL Server]MAX_PROVS: Error Locating Server/Instance Specified [xFFFFFFFF].
[Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired
[Microsoft][ODBC Driver 17 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.

TESTS FAILED!

26
Scripting Languages / Re: ScriptBasic Windows 64 Bit
« Last post by John on August 21, 2021, 06:46:50 pm »
You're the man!

It now works with Postgres SQL 64 bit ODBC. I will give MS SQL server a try as well.

Code: Script BASIC
  1. IMPORT odbc.sbi
  2.  
  3. dbh = odbc::RealConnect("BIO64U","","")
  4. SQL = "SELECT * FROM ar_customer LIMIT 10"
  5. odbc::query(dbh, SQL)
  6. WHILE odbc::Fetchhash(dbh, column)
  7.   PRINT column{"customerno"}," - ",column{"customername"},"\n"
  8. WEND
  9.  
  10. odbc::Close(dbh)
  11.  


C:\ScriptBasic\examples>sbc psql_64.sb
12THMT0 - 12th Man Technologies
AAARBA7 - AAARBA
AABING6 - A.A. Bin Hindi Group
AABS184 - Armstrong Atl St Univ Biol
AABS999 - Armstrong Atl St Univ
AABWTP8 - abr American Business Review
AAC7060 - Anne Arundel CC Biol
AACH476 - Uniklinik RWTH Aachen
AACHEN7 - Universitatsklinikum Aachen
AADUNA8 - Alberto Aduna

C:\ScriptBasic\examples>


I added the change you made to FetchHash to FetchSchema as it is basically a copy of that routine.

Code: C
  1. besFUNCTION(odbc_fetchschema)
  2.   VARIABLE Argument;
  3.   LEFTVALUE Lval;
  4.   podbcHANDLE q;
  5.   int i;
  6.   unsigned long __refcount_;
  7.   podbcOBJECT p;
  8.   // char *pszColNameBuffer;
  9.   SQLCHAR *pszColNameBuffer;
  10.   SQLSMALLINT cbColNameBuffer;
  11.   SQLSMALLINT cbrColNameBuffer;
  12.   SQLSMALLINT DataType;
  13.   // SQLUINTEGER ColSize;
  14.   SQLULEN ColSize;
  15.   SQLSMALLINT DecimalDigits;
  16.   SQLSMALLINT Nullable;
  17.   SQLRETURN ret;
  18.   int iError;
  19.   int typesize;
  20.  
27
Scripting Languages / Re: ScriptBasic Windows 64 Bit
« Last post by John on August 21, 2021, 04:40:37 pm »
Thanks AIR!

I'll give this a try.

You are a wizard. Nothing gets by you.  8)
28
Scripting Languages / Re: ScriptBasic Windows 64 Bit
« Last post by AIR on August 21, 2021, 02:16:56 pm »
This is a good example of what happens when you DON'T follow the API Documentation.

The issue boils down to not properly using the defined TYPES for a library.

For example, using char in place of SQLCHAR.

Another example, which is the reason for the truncated output, is using SQLINTEGER when the correct type is SQLLEN (which automagically accounts for 32 vs 64 bit).

In essence, the function prototypes that the Microsoft SQL Team provide were not adhered to, resulting in the issues under 64Bit.


After making the changes to the variable TYPES, I can connect to and query a MS SQL Express DB (running on my Linux server in a Docker container) with no issues.  In the call to ::RealConnect, I had to provide user/password to connect.


See the attached patch file, run it against the odbc/interface.c from the SB64 archive I sent you, since I don't know what you may have changed in your own local copy.

AIR.

29
Scripting Languages / Re: ScriptBasic Windows 64 Bit
« Last post by John on August 20, 2021, 10:24:42 pm »
I'm not using MySQL. Only Postgres and MS SQL 64 bit servers.

This is a good example why I've given up on Windows 64 and SB in the past. IUP has issues as well running 64 bit.
30
Scripting Languages / Re: ScriptBasic Windows 64 Bit
« Last post by AIR on August 20, 2021, 10:16:50 pm »
Don't you need a 64bit MySQL ODBC connector driver installed and configured?
Pages: 1 2 [3] 4 5 ... 10