Click here to Skip to main content
15,901,001 members
Home / Discussions / Database
   

Database

 
AnswerRe: I need some help from my fellow developers... Pin
Richard MacCutchan12-Jan-17 4:19
mveRichard MacCutchan12-Jan-17 4:19 
GeneralRe: I need some help from my fellow developers... Pin
Steve Naidamast12-Jan-17 5:08
professionalSteve Naidamast12-Jan-17 5:08 
Questionvb.net, select where statement Pin
jkirkerx5-Jan-17 8:12
professionaljkirkerx5-Jan-17 8:12 
AnswerRe: vb.net, select where statement Pin
Wendelius5-Jan-17 8:30
mentorWendelius5-Jan-17 8:30 
GeneralRe: vb.net, select where statement Pin
jkirkerx5-Jan-17 8:39
professionaljkirkerx5-Jan-17 8:39 
GeneralRe: vb.net, select where statement Pin
Wendelius5-Jan-17 8:47
mentorWendelius5-Jan-17 8:47 
GeneralRe: vb.net, select where statement Pin
jkirkerx5-Jan-17 9:17
professionaljkirkerx5-Jan-17 9:17 
QuestionSSIS Excel connection is creating another temporary file and interfering with the FileSystemWatcher Pin
indian1434-Jan-17 8:39
indian1434-Jan-17 8:39 
SuggestionRe: SSIS Excel connection is creating another temporary file and interfering with the FileSystemWatcher Pin
David Mujica4-Jan-17 9:44
David Mujica4-Jan-17 9:44 
GeneralRe: SSIS Excel connection is creating another temporary file and interfering with the FileSystemWatcher Pin
indian1434-Jan-17 10:58
indian1434-Jan-17 10:58 
Questiondoubt in logical schema of database Pin
Member 129343424-Jan-17 3:19
Member 129343424-Jan-17 3:19 
AnswerRe: doubt in logical schema of database Pin
Afzaal Ahmad Zeeshan4-Jan-17 3:42
professionalAfzaal Ahmad Zeeshan4-Jan-17 3:42 
AnswerRe: doubt in logical schema of database Pin
Richard MacCutchan4-Jan-17 5:01
mveRichard MacCutchan4-Jan-17 5:01 
GeneralRe: doubt in logical schema of database Pin
Eddy Vluggen4-Jan-17 7:02
professionalEddy Vluggen4-Jan-17 7:02 
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 

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.