Dim sConn As String = "DRIVER={MySQL ODBC 3.51 Driver};" & _
"SERVER=adminserver;" & _
"DATABASE=scatteredlots;" & _
"UID=bob;" & _
"PASSWORD=intwiz;" & _
"OPTION=3"
Dim cmd As New OdbcCommand
Dim oConn As OdbcConnection = New OdbcConnection(sConn)
oConn.Open()
all parameters
sSQL = "Select TaxIDParcelID, OwnersName, Address1, Address2, Address3, City, " & _
"State, Zip, Country, Phone, Community, ShortLegal, ShortLegal2, ID, Price, " & _
"WillingSellerStatus, WillingPrice, SellableRange, CommissionRate, CommissionGross, " & _
"ClosingFeeAmount, NetProceeds, ContractNotes, LeadSource, LeadNotes, LeadDateAquired, " & _
"Agent, LeadStatus, BuilderID, ActionID, Neighborhood, SentToCallCenter, AnticipatedClosingDate, " & _
"UnitID, ContractRecievedDate, TitleID, ContractExpirationDate from MasterList where TaxIDParcelID IS NOT NULL"
no dates
sSQL = "Select TaxIDParcelID, OwnersName, Address1, Address2, Address3, City, " & _
"State, Zip, Country, Phone, Community, ShortLegal, ShortLegal2, ID, Price, " & _
"WillingSellerStatus, WillingPrice, SellableRange, CommissionRate, CommissionGross, " & _
"ClosingFeeAmount, NetProceeds, ContractNotes, LeadSource, LeadNotes, " & _
"Agent, LeadStatus, BuilderID, ActionID, Neighborhood, SentToCallCenter, " & _
"UnitID, TitleID, ContractExpirationDate from MasterList where TaxIDParcelID IS NOT NULL"
cmd.Connection = oConn
cmd.CommandText = sSQL
Dim odDA As New OdbcDataAdapter(cmd)
Try
odDA.Fill(dt)
Catch ex As Exception
MsgBox(ex.Message)
oConn.Close()
Exit Sub
End Try