Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 3rd, 2006, 01:38 AM
skea skea is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 10 skea User rank is Private First Class (20 - 50 Reputation Level)skea User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 3 h 41 m 5 sec
Reputation Power: 0
SQL Tricking me.

Hello Folks, i have a problem, i am migrating my vb.net app from MS Access to Fb. I am getting a problem with this UPDATE Command. I am meant to Update the last User Record Entered in a table tblLoginDetails before i quit the database. but it gives me this error! and i dont know why.
Any Idea will be highly appreciated.
Here is my Code
Code:
Public Sub logOut()
        Dim strSQL As String = "UPDATE tblLogTimes SET LoggedOut= " & Now & "  WHERE(logID=" & getLastID() & ")"
        Dim myConn As FbConnection = New FbConnection(strFBConn.ToString())
        Dim cmdSQL As FbCommand = New FbCommand(strSQL, myConn)
        MsgBox(strSQL)
        Try
            myConn.Open()
            cmdSQL.ExecuteNonQuery()
            
        Catch ex As OleDbException
            MessageBox.Show("SQL Error:" & ex.Message)
        Catch ex As Exception
            MessageBox.Show("General Error:" & ex.Message)
        Finally
            myConn.Close()
            cmdSQL.Dispose()
            myConn.Dispose()
        End Try
    End Sub


Here is the error message in the attachment.
Attached Images
File Type: jpg Mine.h2.jpg (9.1 KB, 146 views)

Reply With Quote
  #2  
Old July 3rd, 2006, 03:16 AM
skea skea is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 10 skea User rank is Private First Class (20 - 50 Reputation Level)skea User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 3 h 41 m 5 sec
Reputation Power: 0
Got it Resolved

Reply With Quote
  #3  
Old July 3rd, 2006, 04:22 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,917 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 3 Days 15 h 7 m 10 sec
Reputation Power: 279
Quote:
Originally Posted by skea
Got it Resolved
Could you please post your solution for others?

Reply With Quote
  #4  
Old July 3rd, 2006, 04:31 AM
skea skea is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 10 skea User rank is Private First Class (20 - 50 Reputation Level)skea User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 3 h 41 m 5 sec
Reputation Power: 0
Quote:
Originally Posted by pabloj
Could you please post your solution for others?

Code:
Dim strSQL As String = "UPDATE tblLogTimes SET LoggedOut= '" & Now & "'  WHERE(logID=" & getLastID() & ")"
Comments on this post
pabloj agrees: Thanks for posting the solution

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > SQL Tricking me.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT