Results 1 to 4 of 4

Thread: Remote Mysql POS

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2018
    Posts
    38

    Smile Remote Mysql POS

    I'm Trying To Record Dataset Remotly Using My SQL
    And Here Is My Code
    Code:
    Private Sub class_initialize()
    DoEvents
    Set con = New ADODB.Connection
    With con
    .ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=gator4040.hostgator.com;PWD=xxxxxx;UID=xxxxxxx;PORT=3306;DATABASE=xxxxxxxxx;"
    .CursorLocation = adUseClient
    .ConnectionTimeout = 600
    
    .Open
    End With
    
    End Sub
    Code:
    Public con As New ADODB.Connection
    Public rx As New ADODB.Recordset
    Public rxd As New ADODB.Recordset

    Code:
    Private Sub Form_Load()
    Set Connect = New Class1
    End Sub
    Code:
    Private Sub Command1_Click()
    Set rx = New ADODB.Recordset
    rx.Open " select * from tbl_info", con, 3, 3
    With rx
    .AddNew
    .Fields("fname") = Text1
    .Fields("lname") = Text2
    .Update
    End With
    Set rx = Nothing
    
    End Sub

    The Error It Comes If I Inseted Space Into TextBox

    Code:
      Multiple-step operation generated errors. Check each status value.
    Also I Need To Save Unicode Char Into MySQL
    It Saving Weird Char With Unicode

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    13,241

    Re: Remote Mysql POS

    The error indicates that the update failed, most likely due to bad data. You say it happens when you insert a space into the textbox, could it be that you are exceeding the field length for the db? Or perhaps it is not a text field and does not see a space as valid data.

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2018
    Posts
    38

    Re: Remote Mysql POS

    Quote Originally Posted by DataMiser View Post
    The error indicates that the update failed, most likely due to bad data. You say it happens when you insert a space into the textbox, could it be that you are exceeding the field length for the db? Or perhaps it is not a text field and does not see a space as valid data.
    Code:
    Name 	Type 	Collation 	Attributes 	Null 	Default 	Comments 	Extra 	Action
    	1 	fnameIndex 	varchar(60) 	utf8_unicode_ci 		No 	None 	
    
    
    
    2 	lname 	varchar(60) 	utf8_unicode_ci 		No 	None
    If Textbox Contain Unicode Char Like Arabic The Error Comes
    If Textbox Contain A Space , The Error Happens

  4. #4

    Thread Starter
    Member
    Join Date
    Dec 2018
    Posts
    38

    Smile Re: Remote Mysql POS

    Quote Originally Posted by DataMiser View Post
    The error indicates that the update failed, most likely due to bad data. You say it happens when you insert a space into the textbox, could it be that you are exceeding the field length for the db? Or perhaps it is not a text field and does not see a space as valid data.
    I solved this problem by using "Insert Into" statement, Instead of using Ado Recordset for adding records.
    now i have issue with storing hindi or arabic text into mysql
    im using Database Collation = utf8_general_ci , Database Chartset = utf8

    i can unicode char manually from mysql it self but not with vb

    even with this
    Code:
    .ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=gator4090.hostgator.com;PWD=xxxxxxxx;UID=xxxxxxx;PORT=3306;DATABASE=xxxxxxxx;Character Set=utf8;"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width