Click here to Skip to main content
15,891,184 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Check Computer Administrator Pin
Gagan.2025-Sep-08 1:07
Gagan.2025-Sep-08 1:07 
AnswerRe: Check Computer Administrator Pin
jzonthemtn25-Sep-08 0:19
jzonthemtn25-Sep-08 0:19 
GeneralRe: Check Computer Administrator Pin
Gagan.2025-Sep-08 1:08
Gagan.2025-Sep-08 1:08 
QuestionRe: Check Computer Administrator Pin
Gagan.2025-Sep-08 1:26
Gagan.2025-Sep-08 1:26 
AnswerRe: Check Computer Administrator Pin
Jon_Boy25-Sep-08 3:56
Jon_Boy25-Sep-08 3:56 
QuestionOnBeforeKeyPress Pin
Ballita24-Sep-08 18:49
Ballita24-Sep-08 18:49 
AnswerRe: OnBeforeKeyPress Pin
User 81152324-Sep-08 19:08
User 81152324-Sep-08 19:08 
QuestionAsking about Updating SQL Database row Pin
drexler_kk24-Sep-08 18:24
drexler_kk24-Sep-08 18:24 
Dear all,

I found a very weird problem here with my Point-Of-Sales System. I'm using VB.NET 2003 connect MySQL 4.0 database for this system. I really can't figured out what happy to the following situation.

I'm trying to update my database for my system but it failed. I have checked the same SQL query using SQLyog and it works. But when I put into my code,it doesn't perform the UPDATE query as I need.

This is the code I used to test using SQLYog:
UPDATE pos_runningno SET Prefix='01',LastNo='80',Length='8' WHERE LocationCode='KK' AND TerminalCode='CTR01' AND Source='RECEIPTNO';


This is the code I put into my VB.NET code:
Try
            
            ObjComm = New OdbcCommand("UPDATE pos_runningno SET Prefix='01',LastNo=' " & strReceiptNo & " ',Length='8' WHERE LocationCode =' " & TerminalLocate & " ' AND TerminalCode='" & TerminalID & "' AND Source='" & strSource & " '", ObjConn)
            ObjConn.Open()
            ObjComm.ExecuteNonQuery()
            ObjConn.Close()


And I have checked it by changing the data 1 by 1 to the variable inside my system and I found that TerminalLocate is the problem. I have set TerminalLocate is s string and the string value is KK. But it doesn't not update at all and doesn't provide any error message from the system.

This is the structure of my database table for this row which I need to use to update:


Field         Type         Collation          Null    Key     Default  Extra   Privileges                       Comment
------------  -----------  -----------------  ------  ------  -------  ------  -------------------------------  -------
LocationCode  varchar(10)  latin1_swedish_ci  NO      PRI                      select,insert,update,references         
TerminalCode  varchar(10)  latin1_swedish_ci  NO      PRI                      select,insert,update,references         
Source        varchar(20)  latin1_swedish_ci  NO      PRI                      select,insert,update,references         
Prefix        varchar(5)   latin1_swedish_ci  YES             (NULL)           select,insert,update,references         
LastNo        int(11)      (NULL)             YES             0                select,insert,update,references         
Length        int(11)      (NULL)             YES             0                select,insert,update,references         


Anyone can tell me why this weird things could happen? And how to solve this matter?

Thanks for reading and hope to get someone help to solve it.

Regards
Drex
AnswerRe: Asking about Updating SQL Database row Pin
Johan Hakkesteegt24-Sep-08 22:03
Johan Hakkesteegt24-Sep-08 22:03 
GeneralRe: Asking about Updating SQL Database row Pin
drexler_kk24-Sep-08 22:46
drexler_kk24-Sep-08 22:46 
GeneralRe: Asking about Updating SQL Database row Pin
Johan Hakkesteegt25-Sep-08 0:35
Johan Hakkesteegt25-Sep-08 0:35 
QuestionFormat Dates of TextBox or DateTimePicker Pin
sur07124-Sep-08 15:26
sur07124-Sep-08 15:26 
AnswerRe: Format Dates of TextBox or DateTimePicker Pin
User 81152324-Sep-08 17:52
User 81152324-Sep-08 17:52 
GeneralRe: Format Dates of TextBox or DateTimePicker Pin
sur07124-Sep-08 23:41
sur07124-Sep-08 23:41 
GeneralRe: Format Dates of TextBox or DateTimePicker Pin
User 81152325-Sep-08 10:21
User 81152325-Sep-08 10:21 
QuestionWeird IE7 DocumentComplete Error. Pin
User 81152324-Sep-08 12:23
User 81152324-Sep-08 12:23 
AnswerRe: Weird IE7 DocumentComplete Error. Pin
Steven J Jowett24-Sep-08 13:05
Steven J Jowett24-Sep-08 13:05 
GeneralRe: Weird IE7 DocumentComplete Error. Pin
User 81152324-Sep-08 15:41
User 81152324-Sep-08 15:41 
GeneralRe: Weird IE7 DocumentComplete Error. Pin
Johan Hakkesteegt24-Sep-08 21:42
Johan Hakkesteegt24-Sep-08 21:42 
GeneralRe: Weird IE7 DocumentComplete Error. [modified] Pin
User 81152325-Sep-08 10:14
User 81152325-Sep-08 10:14 
GeneralRe: Weird IE7 DocumentComplete Error. [modified] Pin
User 81152325-Sep-08 12:03
User 81152325-Sep-08 12:03 
QuestionFont Color Change Pin
Member 457761924-Sep-08 8:42
Member 457761924-Sep-08 8:42 
AnswerRe: Font Color Change Pin
Dave Kreskowiak24-Sep-08 9:34
mveDave Kreskowiak24-Sep-08 9:34 
AnswerRe: Font Color Change Pin
Paul Conrad24-Sep-08 10:57
professionalPaul Conrad24-Sep-08 10:57 
AnswerRe: Font Color Change Pin
Steven J Jowett24-Sep-08 11:13
Steven J Jowett24-Sep-08 11:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.