Click here to Skip to main content
15,921,793 members
Home / Discussions / Database
   

Database

 
AnswerRe: MySql - No results from query with WHERE Pin
Bernhard Hiller2-Jan-17 21:01
Bernhard Hiller2-Jan-17 21:01 
GeneralRe: MySql - No results from query with WHERE Pin
BobbyStrain3-Jan-17 4:30
BobbyStrain3-Jan-17 4:30 
QuestionDelete rows from a foxpro dbf file, that seems to be locked Pin
jkirkerx28-Dec-16 13:04
professionaljkirkerx28-Dec-16 13:04 
AnswerRe: Delete rows from a foxpro dbf file, that seems to be locked Pin
CHill6029-Dec-16 3:59
mveCHill6029-Dec-16 3:59 
GeneralRe: Delete rows from a foxpro dbf file, that seems to be locked Pin
jkirkerx29-Dec-16 7:04
professionaljkirkerx29-Dec-16 7:04 
AnswerI got this working partially, but can't figure out why I can't delete by Invoice Number Pin
jkirkerx29-Dec-16 8:07
professionaljkirkerx29-Dec-16 8:07 
GeneralI got it working, not sure it will always work Pin
jkirkerx29-Dec-16 9:23
professionaljkirkerx29-Dec-16 9:23 
QuestionUpdating a FoxPro dbf file using VB.net Pin
jkirkerx22-Dec-16 11:32
professionaljkirkerx22-Dec-16 11:32 
This is the first I'm trying to update a row in a FoxPro DBF file.

My code runs without error, but the row just won't update. I get a 0 back from ExecuteNonQuery
I tried hard coding the customer number but same thing.
Tried just updating 1 column FCOMPANY, same thing.

I must be missing something here, like perhaps a cursor or something.
The SELECT line was a feeble attempt to try something.
Dim m_path As String = Nothing
        Dim dwXCode As Integer = registry_shared.read_HKCU_dataPath(m_path)
        Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & m_path & "; Extended Properties=dBASE IV"
        Const queryString As String = _
        "SELECT * FROM ARCUS01.dbf WHERE FCUSTNO = @FCUSTNO " & _
        " UPDATE ARCUS01.dbf " & _
        " SET " & _
        "  FCOMPANY = 'Wiped Customer' " & _
        ", FADDR1 = @Empty " & _
        ", FADDR2 = @Empty " & _
        ", FCITY = @Empty " & _
        ", FSTATE = @Empty " & _
        ", FZIP = @Empty " & _
        ", FSADDR1 = @Empty " & _
        ", FSADDR2 = @Empty " & _
        ", FSCITY = @Empty " & _
        ", FSSTATE = @Empty " & _
        ", FSZIP = @Empty " & _
        ", FPHONE1 = @Empty " & _
        ", FFAX = @Empty " & _
        ", FFNAME = @Empty " & _
        ", FLNAME = @Empty " & _
        ", FTITLE = @Empty " & _
        ", FSALESPN = @Empty " & _
        ", FTERR = @Empty " & _
        ", FRESALENO = @Empty " & _
        ", FLPDATE = @Empty " & _
        ", FLPAMT = 0 " & _
        ", FATDSAMT = 0 " & _
        ", FYTDSAMT = 0 " & _
        " WHERE FCUSTNO = @FCUSTNO "

        Using connection As New System.Data.OleDb.OleDbConnection(connString)
            Using command As New System.Data.OleDb.OleDbCommand(queryString, connection)

                Dim paramWipe As System.Data.OleDb.OleDbParameter
                paramWipe = New System.Data.OleDb.OleDbParameter("@Empty", OleDbType.VarChar)
                paramWipe.Value = String.Empty
                command.Parameters.Add(paramWipe)

                Dim paramZero As System.Data.OleDb.OleDbParameter
                paramZero = New System.Data.OleDb.OleDbParameter("@Zero", OleDbType.Decimal)
                paramZero.Value = 0.0
                command.Parameters.Add(paramZero)

                Dim paramFCUSTNO As System.Data.OleDb.OleDbParameter
                paramFCUSTNO = New System.Data.OleDb.OleDbParameter("@FCUSTNO", OleDbType.VarChar)
                paramFCUSTNO.Value = p
                command.Parameters.Add(paramFCUSTNO)

                Try

                    connection.Open()
                    Dim x As Integer = command.ExecuteNonQuery()
                    pValue = If(x > 0, True, False)

                Catch sqlEx As SqlClient.SqlException
                    pValue = False

                Catch exdb As OleDb.OleDbException
                    pValue = False

                Catch ex As Exception
                    pValue = False

                Finally

                    connection.Close()

                End Try

            End Using
        End Using
21st Century Globalism has become Socialism on a planetary scale, in which the unequal treaties of the past have come back into play.

AnswerRe: Updating a FoxPro dbf file using VB.net Pin
jkirkerx22-Dec-16 11:37
professionaljkirkerx22-Dec-16 11:37 
AnswerRe: Updating a FoxPro dbf file using VB.net Pin
jschell26-Dec-16 7:17
jschell26-Dec-16 7:17 
GeneralRe: Updating a FoxPro dbf file using VB.net Pin
jkirkerx27-Dec-16 7:09
professionaljkirkerx27-Dec-16 7:09 
QuestionDrop & Recreate the DB Pin
Kevin Marois21-Dec-16 12:48
professionalKevin Marois21-Dec-16 12:48 
AnswerRe: Drop & Recreate the DB Pin
Chris Quinn21-Dec-16 22:03
Chris Quinn21-Dec-16 22:03 
GeneralRe: Drop & Recreate the DB Pin
Kevin Marois22-Dec-16 4:37
professionalKevin Marois22-Dec-16 4:37 
QuestionRe: Drop & Recreate the DB Pin
Richard MacCutchan22-Dec-16 4:59
mveRichard MacCutchan22-Dec-16 4:59 
AnswerRe: Drop & Recreate the DB Pin
Kevin Marois22-Dec-16 4:59
professionalKevin Marois22-Dec-16 4:59 
AnswerRe: Drop & Recreate the DB Pin
Simon_Whale22-Dec-16 5:49
Simon_Whale22-Dec-16 5:49 
GeneralRe: Drop & Recreate the DB Pin
Kevin Marois22-Dec-16 5:54
professionalKevin Marois22-Dec-16 5:54 
QuestionSQL 2012 Restore Problem Pin
Kevin Marois21-Dec-16 4:46
professionalKevin Marois21-Dec-16 4:46 
AnswerRe: SQL 2012 Restore Problem Pin
Richard Deeming21-Dec-16 6:00
mveRichard Deeming21-Dec-16 6:00 
GeneralRe: SQL 2012 Restore Problem Pin
Kevin Marois21-Dec-16 6:02
professionalKevin Marois21-Dec-16 6:02 
Questionerror occurred while enabling mars for this connection Pin
Travelthrprog18-Dec-16 7:56
Travelthrprog18-Dec-16 7:56 
AnswerRe: error occurred while enabling mars for this connection Pin
Eddy Vluggen21-Dec-16 4:52
professionalEddy Vluggen21-Dec-16 4:52 
QuestionTrying to access ReadWrite and ReadOnly variables in Script Component's ProcessInputRow Pin
indian14310-Dec-16 14:35
indian14310-Dec-16 14:35 
QuestionJet OLE, multiple joins with a union, missing an operator or brackets Pin
jkirkerx9-Dec-16 6:16
professionaljkirkerx9-Dec-16 6:16 

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.