1. Alexis Colon Lugo
  2. Valentina Server
  3. Friday, July 12 2019, 01:54 PM
  4.  Subscribe via email
Dim sqlLocation As Text = App.mSessionURL + "/sql_fast"
mSQLSocket.Start( App.mHost, App.mSessionID, sqlLocation, "SQLite", "ipadcrnew.db", " Insert into main(socionum,name,last_name,cell,address) value ( '2' , 'jose' , 'lugo' , 'abc' , 'jajaj' );";)
Comment
There are no comments made yet.
Alexis Colon Lugo Accepted Answer
Ok
If I use Valentina DB and no SQLite can this works without problems
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 21
Sergey Pashkov Accepted Answer
Unfortunately, it can cause problems for Valentina DB, too. It is really unexpected to get Byte Order Mark from Xojo source code.
So, until we start to filter it, the best way is to clear BOM in the HEX editor (backup Xojo project before modification!).

Another option is to filter it in your application code. I'll try to add an example tomorrow.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 22
Sergey Pashkov Accepted Answer
Hello Alexis,

It's easy to fix query in Xojo code, just modify DoSQLSocket Start method:
...
dict.Value( "query" ) = inQuery.ReplaceAll( Text.FromUnicodeCodepoint(&hFEFF ), "" )
...

It removes all BOM characters, both for SQLite and Valentina DBs.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 23
Alexis Colon Lugo Accepted Answer
// Set the request authentication headers
RequestHeader("Accept";) = "application/json"
RequestHeader("Content-Type";) = "application/json"
RequestHeader("Cookie";) = inSessionID

Dim url As Text = inHost + inSQLURL

// Prepare data
Dim dict As New Dictionary
dict.Value("vendor";) = inSQLVendor
dict.Value("database";) = inSQLDatabase
dict.Value("query";) = inQuery.ReplaceAll(Text.FromUnicodeCodepoint(&hFEFF ),"";)

Dim json As Text = Xojo.Data.GenerateJSON(dict)
Dim data As MemoryBlock = Xojo.Core.TextEncoding.UTF8.ConvertTextToData(json)

SetRequestContent(data,"application/json";)

// Send the POST request
Send("POST",url)
Attachments (1)
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 24
Sergey Pashkov Accepted Answer
The error is in database name again, please add ReplaceAll to vendor and database
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 25
Alexis Colon Lugo Accepted Answer
Same error


// Set the request authentication headers
RequestHeader("Accept";) = "application/json"
RequestHeader("Content-Type";) = "application/json"
RequestHeader("Cookie";) = inSessionID

Dim url As Text = inHost + inSQLURL

// Prepare data
Dim dict As New Dictionary
dict.Value("vendor";) = inSQLVendor.ReplaceAll(Text.FromUnicodeCodepoint(&hFEFF ),"";)
dict.Value("database";) = inSQLDatabase.ReplaceAll(Text.FromUnicodeCodepoint(&hFEFF ),"";)
dict.Value("query";) = inQuery.ReplaceAll(Text.FromUnicodeCodepoint(&hFEFF ),"";)

Dim json As Text = Xojo.Data.GenerateJSON(dict)
Dim data As MemoryBlock = Xojo.Core.TextEncoding.UTF8.ConvertTextToData(json)

SetRequestContent(data,"application/json";)

// Send the POST request
Send("POST",url)
Attachments (1)
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 26
Sergey Pashkov Accepted Answer
Does the call to this socket look like

mSQLSocket.Start( App.mHost, App.mSessionID, sqlLocation, "SQLite", "ipadcrnew.db"

?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 27
Alexis Colon Lugo Accepted Answer
thanks
now works it was the database extension was missing
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 28
  • Page :
  • 1
  • 2


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 0 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories
Omegabundle
  1. 0 subcategories