Click here to Skip to main content
15,903,201 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How to Make a folder virtual folder using vb 6.0? Pin
Dave Kreskowiak31-Aug-07 3:41
mveDave Kreskowiak31-Aug-07 3:41 
GeneralRe: How to Make a folder virtual folder using vb 6.0? Pin
Paul Conrad23-Dec-07 15:04
professionalPaul Conrad23-Dec-07 15:04 
QuestionSelecting next row in datagrid Pin
jensenx30-Aug-07 18:11
jensenx30-Aug-07 18:11 
AnswerRe: Selecting next row in datagrid Pin
Naji El Kotob30-Aug-07 21:51
Naji El Kotob30-Aug-07 21:51 
Questionediting cells in a datagridview Pin
steve_rm30-Aug-07 16:33
steve_rm30-Aug-07 16:33 
QuestionVB6 HTML elements offsetParent recursive problem Pin
eugeugeug12330-Aug-07 14:02
eugeugeug12330-Aug-07 14:02 
AnswerRe: VB6 HTML elements offsetParent recursive problem Pin
Dave Kreskowiak31-Aug-07 3:38
mveDave Kreskowiak31-Aug-07 3:38 
QuestionVB.NET Access DB DataSet problem Pin
culbysl30-Aug-07 13:40
culbysl30-Aug-07 13:40 
I have dropped all my emails into an access database, and now building a vb.NET windows app to query to return needed email bodies. The application runs through the database dataset function and returns 0 rows. I console.writeline the connection string and SQL statement and am able to pull records from the database. I can't see what I have wrong in the code. The function hitting the database is listed below. Please any help would be a really great thing. Thanks in advance.

Public Function GetSelectAnd2Records(ByVal strTableName, ByVal strCriteria1, ByVal strCriteria3) As DataSet
Dim ds As New DataSet
Dim strSQL As String
Dim dbConn As New OleDbConnection
dbConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\NovaEmailKB\KNOWLEDGE BASE SSC.mdb;"

strCriteria1 = "*" & strCriteria1 & "*"
strCriteria3 = "*" & strCriteria3 & "*"

strSQL = "SELECT [ID], [Subject], [Body], [Received], [From] " & _
"FROM " & strTableName & " " & _
"WHERE (((Body) Like """ & strCriteria1 & """ And (Terminals.Body) Like """ & strCriteria3 & """)) " & _
"ORDER BY Received DESC; "

Dim cn As New OleDbConnection(dbConn.ConnectionString)
Dim cmd As New OleDbCommand(strSQL, cn)
Dim da As New OleDbDataAdapter(cmd)

Console.WriteLine(dbConn.ConnectionString)
Console.WriteLine(strSQL)

Try
cn.Open()

Console.WriteLine(cn.State)

cmd.Connection = cn
cmd.CommandText = strSQL
cmd.ExecuteNonQuery()

da.Fill(ds, "SelectAnd2Rtn")

If cn.State = ConnectionState.Open Then
cn.Close()
End If

cn.Dispose()
cn = Nothing
da.Dispose()
da = Nothing

Catch ex As Exception
MsgBox("An unexpected MS Access error has occured: " & ex.Message)

If cn.State = ConnectionState.Open Then
cn.Close()
End If

cn.Dispose()
cn = Nothing
da.Dispose()
da = Nothing

Return Nothing

Exit Function

End Try

Return ds

End Function
AnswerRe: VB.NET Access DB DataSet problem Pin
Dave Kreskowiak31-Aug-07 3:33
mveDave Kreskowiak31-Aug-07 3:33 
GeneralRe: VB.NET Access DB DataSet problem Pin
culbysl31-Aug-07 11:52
culbysl31-Aug-07 11:52 
GeneralRe: VB.NET Access DB DataSet problem Pin
Dave Kreskowiak1-Sep-07 4:15
mveDave Kreskowiak1-Sep-07 4:15 
GeneralRe: VB.NET Access DB DataSet problem Pin
culbysl1-Sep-07 7:51
culbysl1-Sep-07 7:51 
QuestionLoading Google Toolbars in a windows form Pin
Ahmad Zaidi30-Aug-07 10:08
Ahmad Zaidi30-Aug-07 10:08 
QuestionClickOnce Depolyment Pin
DarkJudge30-Aug-07 8:32
DarkJudge30-Aug-07 8:32 
AnswerRe: ClickOnce Depolyment Pin
Mycroft Holmes30-Aug-07 16:33
professionalMycroft Holmes30-Aug-07 16:33 
QuestionAudio Volume Levels in VB6 Pin
Kevnar30-Aug-07 6:29
Kevnar30-Aug-07 6:29 
QuestionOpening all Files within a folder using the FileBrowserDialog Pin
Mr Oizo30-Aug-07 4:41
Mr Oizo30-Aug-07 4:41 
AnswerRe: Opening all Files within a folder using the FileBrowserDialog Pin
Kschuler30-Aug-07 6:29
Kschuler30-Aug-07 6:29 
GeneralRe: Opening all Files within a folder using the FileBrowserDialog Pin
Mr Oizo30-Aug-07 9:02
Mr Oizo30-Aug-07 9:02 
QuestionSwitching to an active Application Pin
programmerwantabe30-Aug-07 4:34
programmerwantabe30-Aug-07 4:34 
AnswerRe: Switching to an active Application Pin
Dave Kreskowiak30-Aug-07 6:48
mveDave Kreskowiak30-Aug-07 6:48 
GeneralRe: Switching to an active Application Pin
programmerwantabe30-Aug-07 7:03
programmerwantabe30-Aug-07 7:03 
QuestionHai all Dynamic Developers.. Pin
Biswaranjan Maharana30-Aug-07 1:16
Biswaranjan Maharana30-Aug-07 1:16 
QuestionUse a PHP Webservice in VB.NET WinApp Pin
j5136p130-Aug-07 1:03
j5136p130-Aug-07 1:03 
AnswerRe: Use a PHP Webservice in VB.NET WinApp Pin
Naji El Kotob30-Aug-07 10:53
Naji El Kotob30-Aug-07 10:53 

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.