Hi,
try to use clasic JDBC for Sql server... I'm using now mssql-jdbc-9.4.0.jre11.jar and work everything correct...
If you need - here are how to add jar into B4J:
1. Download microsoft Jdbc driver for sql server:
Download MS Jdbc
2. Copy jar to Additional libraries
3. Add Jar as Additional Jar into B4J Region project Attributes:
#Region Project Attributes
#MainFormWidth: 1024
#MainFormHeight: 768
#AdditionalJar: mysql-connector-java-5.1.48-bin.jar
#AdditionalJar: mssql-jdbc-9.4.0.jre11.jar
#AdditionalJar: sqlite-jdbc-3.31.1.jar
#PackagerProperty: IconFile = ..\Files\IcoInvoices.ico
#PackagerProperty: ExeName = OptInvoining
#End Region
4. Create Init routine to connect to Sql server database - like this:
Sub InitIps As ResumableSub
Dim dbInit As String = $"jdbc:sqlserver://${ip/server name}:${port - default: 1433};databaseName=${yourdatabasename};user=${username};password=${Password};"$
Try
IpsSql.Initialize2("com.microsoft.sqlserver.jdbc.SQLServerDriver", dbInit, username, password)
Catch
Log(LastException)
Return False
End Try
Return True
End Sub
Change Ip of server, port, username, password and database name
IpsSql is declared as Sql
Last version of Sql server (express) is 2022 and has limited database size = 10Gb (per database). If is your database to big, you need to switch to sql server standard edition which is not free-of-charge. If are over database size and want not to pay microsoft, you have two options:
1. delete older data or trasfer it to another database or
2. create new database which will include data from now, older data can stay in old database. You can combine then data with select over two databases like:
select datafromOld.*, datafromNew.*
from [datafromolddb].dbo.[mytable] as datafromOld inner join [datafromnewdb].dbo.[mytable] as datafromNew on datafromOld.id = datafromnew.Id
Hope, this will help you...