Click here to Skip to main content
15,887,214 members
Home / Discussions / Database
   

Database

 
GeneralRe: doubt in logical schema of database Pin
Richard MacCutchan4-Jan-17 22:04
mveRichard MacCutchan4-Jan-17 22:04 
QuestionMySql - No results from query with WHERE Pin
BobbyStrain2-Jan-17 16:44
BobbyStrain2-Jan-17 16:44 
AnswerRe: MySql - No results from query with WHERE Pin
Mycroft Holmes2-Jan-17 20:45
professionalMycroft Holmes2-Jan-17 20:45 
GeneralRe: MySql - No results from query with WHERE Pin
Jörgen Andersson2-Jan-17 22:56
professionalJörgen Andersson2-Jan-17 22:56 
GeneralRe: MySql - No results from query with WHERE Pin
Mycroft Holmes3-Jan-17 10:29
professionalMycroft Holmes3-Jan-17 10:29 
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 
The same project again. Yes I know it's old, and I'm not the author of it, but it's quick cash.

I have this dbf file that seems to be locked or something. In some other dbf files, I can delete a record. But in this one, even using another program called DBF Manager, I can't delete rows.

So I tried 2 methods, using 2 different drivers.
The dbf file has about say 20 rows for invoice number 28794, and in the 2nd example returns 1 in ExecuteNonQuery

The first method I tried was using Jet, which is what I used through out the program.
But I get a 0 back from ExecuteNonQuery
Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & m_path
        Const queryString1 As String = _
        " DELETE FROM ARTRS01H.dbf h " & _
        " WHERE h.FINVNO = @FINVNO "

        Const queryString2 As String = _
        " DELETE FROM ARTRS01.dbf v " & _
        " WHERE v.FINVNO = @FINVNO "

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

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

                Try
                    connection.Open()
                    Dim x As Integer = command.ExecuteNonQuery()
                    command.CommandText = queryString2
                    x += 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

The 2nd method I tried was using the Visual Fox Pro, in which I get a 1 back from ExecuteNonQuery
Dim connString As String = "Provider=VFPOLEDB; Data Source=" & m_path & ";"
        Dim queryString1 As String = _
        " SET EXCLUSIVE ON" & _
        " DELETE FROM ARTRS01H.dbf " & _
        " WHERE FINVNO = '" & p & "' " & _
        " PACK "

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

                Try
                    connection.Open()
                    command.CommandType = CommandType.StoredProcedure
                    command.CommandText = "ExecScript"
                    command.Parameters.Add("script1", OleDbType.Char).Value = queryString1
                    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

I'd thought and see if any folks out there may flash back 20 years on this.
21st Century Globalism has become Socialism on a planetary scale, in which the unequal treaties of the past have come back into play.

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 
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 

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.