Click here to Skip to main content
15,917,622 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHow to connect to Pocket PC(Windows Mobile) from Desktop PC? Pin
pyothinwat16-Jul-08 21:04
pyothinwat16-Jul-08 21:04 
AnswerRe: How to connect to Pocket PC(Windows Mobile) from Desktop PC? Pin
~Khatri Mitesh~17-Jul-08 0:26
~Khatri Mitesh~17-Jul-08 0:26 
GeneralRe: How to connect to Pocket PC(Windows Mobile) from Desktop PC? Pin
pyothinwat17-Jul-08 0:43
pyothinwat17-Jul-08 0:43 
GeneralRe: How to connect to Pocket PC(Windows Mobile) from Desktop PC? Pin
pyothinwat17-Jul-08 0:44
pyothinwat17-Jul-08 0:44 
AnswerRe: How to connect to Pocket PC(Windows Mobile) from Desktop PC? Pin
Rupsaa17-Jul-08 1:25
Rupsaa17-Jul-08 1:25 
Questioni am using Using the MSScript control in win application. Pin
Piyush Vardhan Singh16-Jul-08 19:57
Piyush Vardhan Singh16-Jul-08 19:57 
AnswerRe: i am using Using the MSScript control in win application. Pin
Piyush Vardhan Singh16-Jul-08 20:54
Piyush Vardhan Singh16-Jul-08 20:54 
QuestionAbout Escape String for VB.NET connect MySQL Pin
drexler_kk16-Jul-08 17:10
drexler_kk16-Jul-08 17:10 
Hello all,

I'm using VB.NET(VS2003) connect with MySQL5.0 database. I'm trying to migrate the previous system which is using VB6 to VB.NET here.I am not familiar with VB6 code and I found this problem below:

Public Function CSQLQuote(ByVal Value As String) As String
'    Value = Replace(Value, "\", "\\")
'    CSQLQuote = Replace(Value, "'", "''")
    CSQLQuote = mysql_escape_string(Value)
End Function

'API DECLARATION FOR mysql_escape_string FUNCTION CALL
Public Declare Function api_mysql_escape_string Lib "libmySQL.dll" _
        Alias "mysql_escape_string" _
        (ByVal strTo As String, _
         ByVal strFrom As String, _
         ByVal lngLength As Long _
        ) As Long

Public Function mysql_escape_string(dirtystring As String) As String
    Dim strFrom As String           'SOURCE STRING PASSED TO FUNCTION
    Dim lngFromLength As String     'LENGTH OF SOURCE STRING
    Dim strTo As String             'DESTINATION STRING COMING FROM FUNCTION
    Dim lngToLength As Long         'LENGTH OF DESTINATION STRING
    
    strFrom = dirtystring           'STORE FUNCTION INPUT
    lngFromLength = Len(strFrom)    'GET LENGTH OF INPUT
    
    strTo = Space(lngFromLength * 2 + 1) 'ALLOCATE A BUFFER FOR OUTPUT OF FUNCTION
                                         '2 BYTES PER CHARACTER PLUS A BYTE FOR NULL
                                         'TERMINATOR USED BY FUNCTION
    
    lngToLength = api_mysql_escape_string(strTo, strFrom, lngFromLength) 'CALL API
    
    mysql_escape_string = Left(strTo, lngToLength) 'TRIM NULL TERMINATOR
End Function

These function will be called inside the SQL query like this:
strSQL = "SELECT LocationCode, TerminalCode, Source, Prefix, LastNo, Length" & _
        " FROM POS_RunningNo" & _
        " WHERE LocationCode='" & CSQLQuote(strLocationCode) & "'" & _
        " AND TerminalCode ='" & CSQLQuote(strTerminalCode) & "'" & _
        " AND Source='" & CSQLQuote(strSource) & "'"


I'm wondering I still need to used the above function apply on my new VB.NET system or I can just directly used the normal SQL query? And anyone can tell me whats the function above trying to do?

Hope someone can give me some ideas about it.Thanks for reading.

Regards
Drex
AnswerRe: About Escape String for VB.NET connect MySQL Pin
N a v a n e e t h16-Jul-08 19:56
N a v a n e e t h16-Jul-08 19:56 
QuestionRe: About Escape String for VB.NET connect MySQL Pin
drexler_kk16-Jul-08 20:25
drexler_kk16-Jul-08 20:25 
AnswerRe: About Escape String for VB.NET connect MySQL Pin
N a v a n e e t h17-Jul-08 17:09
N a v a n e e t h17-Jul-08 17:09 
QuestionRe: About Escape String for VB.NET connect MySQL Pin
drexler_kk17-Jul-08 17:50
drexler_kk17-Jul-08 17:50 
AnswerRe: About Escape String for VB.NET connect MySQL Pin
N a v a n e e t h18-Jul-08 17:04
N a v a n e e t h18-Jul-08 17:04 
QuestionRe: About Escape String for VB.NET connect MySQL Pin
drexler_kk20-Jul-08 17:50
drexler_kk20-Jul-08 17:50 
AnswerRe: About Escape String for VB.NET connect MySQL Pin
N a v a n e e t h20-Jul-08 20:38
N a v a n e e t h20-Jul-08 20:38 
GeneralRe: About Escape String for VB.NET connect MySQL Pin
drexler_kk21-Jul-08 16:31
drexler_kk21-Jul-08 16:31 
GeneralRe: About Escape String for VB.NET connect MySQL Pin
N a v a n e e t h21-Jul-08 16:49
N a v a n e e t h21-Jul-08 16:49 
QuestionI need help....!! Pin
Member 374662916-Jul-08 17:07
Member 374662916-Jul-08 17:07 
AnswerRe: I need help....!! Pin
Christian Graus16-Jul-08 17:59
protectorChristian Graus16-Jul-08 17:59 
GeneralRe: I need help....!! Pin
Paul Conrad17-Jul-08 16:43
professionalPaul Conrad17-Jul-08 16:43 
AnswerRe: I need help....!! Pin
Paul Conrad17-Jul-08 16:43
professionalPaul Conrad17-Jul-08 16:43 
Questionformatting numbers from a text box Pin
digicd116-Jul-08 11:06
digicd116-Jul-08 11:06 
AnswerRe: formatting numbers from a text box Pin
Mycroft Holmes16-Jul-08 20:17
professionalMycroft Holmes16-Jul-08 20:17 
GeneralRe: formatting numbers from a text box Pin
digicd122-Jul-08 10:49
digicd122-Jul-08 10:49 
QuestionORA-06502: PL/SQL: numeric or value error: character string buffer too smal Pin
ljammala16-Jul-08 10:39
ljammala16-Jul-08 10:39 

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.