Click here to Skip to main content
16,007,504 members
Home / Discussions / Database
   

Database

 
AnswerRe: ExecuteSQL -> ? Pin
Mazdak12-Feb-02 10:08
Mazdak12-Feb-02 10:08 
GeneralRe: ExecuteSQL -> ? Pin
Carlos Antollini12-Feb-02 10:17
Carlos Antollini12-Feb-02 10:17 
GeneralXA Transactions Pin
Mauricio Ritter12-Feb-02 1:41
Mauricio Ritter12-Feb-02 1:41 
Generalwhat's the Max length of words in _bstr_t Pin
Zell10-Feb-02 20:59
Zell10-Feb-02 20:59 
GeneralRe: what's the Max length of words in _bstr_t Pin
Bill Wilson5-Mar-02 8:49
Bill Wilson5-Mar-02 8:49 
Generalimport a text file sorting a list of values Pin
chris foote10-Feb-02 18:02
chris foote10-Feb-02 18:02 
GeneralRe: import a text file sorting a list of values Pin
Mazdak10-Feb-02 20:44
Mazdak10-Feb-02 20:44 
GeneralRe: import a text file sorting a list of values Pin
chris foote11-Feb-02 3:24
chris foote11-Feb-02 3:24 
Thanks for responding, I am not connecting to any SQL server. I am just opening a text file and populating a recordset My code is below.

After I run this I am having trouble finding a way to just get a list of unique QueueName's from the recordset??

I create a recordset via this code....

Set rs = New Recordset
rs.CursorLocation = adUseClient
rs.Fields.Append "UserName", adBSTR, 128
rs.Fields.Append "DocName", adBSTR, 128
rs.Fields.Append "QueueName", adBSTR, 128
rs.Fields.Append "Date", adDBDate
rs.Fields.Append "Time", adDBTimeStamp
rs.Fields.Append "Workstation", adBSTR, 128
rs.Fields.Append "ClientCode", adBSTR, 128
rs.Fields.Append "Subcode", adBSTR, 128
rs.Fields.Append "PaperSize", adBSTR, 128
rs.Fields.Append "Features", adBSTR, 128
rs.Fields.Append "Sizeinbytes", adBSTR, 128
rs.Fields.Append "Pagecount", adBSTR, 128
rs.Fields.Append "cost", adBSTR, 128
rs.Fields.Append "AccountBalance", adBSTR, 128
rs.Open

Then I import the txt file into the recordset using this code...

Dim F As Long, sLine As String, A(0 To 13) As String

F = FreeFile
Open "C:\temp\text.txt" For Input As F

Do While Not EOF(F)
Line Input #F, sLine
ParseToArray sLine, A()
rs.AddNew
rs.Fields(0) = A(0)
rs.Fields(1) = A(1)
rs.Fields(2) = A(2)
rs.Fields(3) = CDate(A(3))
rs.Fields(4) = CDate(A(4))
rs.Fields(5) = A(5)
rs.Fields(6) = A(6)
rs.Fields(7) = A(7)
rs.Fields(8) = A(8)
rs.Fields(9) = A(9)
rs.Fields(10) = A(10)
rs.Fields(11) = A(11)
rs.Fields(12) = A(12)
rs.Fields(13) = A(13)
rs.Update
DoEvents
Loop

Close #F

End Sub
Sub ParseToArray(sLine As String, A() As String)
Dim P As Long, LastPos As Long, i As Long
P = InStr(sLine, ",")
Do While P
A(i) = Mid$(sLine, LastPos + 1, P - LastPos - 1)
LastPos = P
i = i + 1
P = InStr(LastPos + 1, sLine, ",", vbBinaryCompare)
Loop
A(i) = Mid$(sLine, LastPos + 1)
End Sub
GeneralRe: import a text file sorting a list of values Pin
Mazdak11-Feb-02 3:48
Mazdak11-Feb-02 3:48 
GeneralRe: import a text file sorting a list of values Pin
Bill Wilson5-Mar-02 9:07
Bill Wilson5-Mar-02 9:07 
GeneralRe: OOPS Never mind Pin
Bill Wilson5-Mar-02 9:09
Bill Wilson5-Mar-02 9:09 
GeneralADO Failed to create first record Pin
10-Feb-02 9:40
suss10-Feb-02 9:40 
GeneralRe: ADO Failed to create first record Pin
Mazdak10-Feb-02 10:48
Mazdak10-Feb-02 10:48 
GeneralRe: ADO Failed to create first record Pin
10-Feb-02 12:39
suss10-Feb-02 12:39 
GeneralRe: ADO Failed to create first record Pin
Mazdak10-Feb-02 20:43
Mazdak10-Feb-02 20:43 
Generalsearch in records Pin
Mazdak10-Feb-02 9:03
Mazdak10-Feb-02 9:03 
GeneralRe: search in records Pin
AndyG10-Feb-02 12:55
AndyG10-Feb-02 12:55 
GeneralRe: search in records Pin
Mazdak10-Feb-02 20:45
Mazdak10-Feb-02 20:45 
GeneralSqlBinary to Integer Pin
Steve Severance4-Feb-02 9:26
Steve Severance4-Feb-02 9:26 
Generalvarchar(1024) truncated to 255 Chars Pin
28-Jan-02 15:13
suss28-Jan-02 15:13 
GeneralRe: varchar(1024) truncated to 255 Chars Pin
1-Feb-02 6:15
suss1-Feb-02 6:15 
QuestionDELETE FROM ... not affecting the table? Pin
David Wulff28-Jan-02 14:45
David Wulff28-Jan-02 14:45 
AnswerRe: DELETE FROM ... not affecting the table? Pin
SimonS28-Jan-02 20:28
SimonS28-Jan-02 20:28 
GeneralRe: DELETE FROM ... not affecting the table? Pin
David Wulff31-Jan-02 4:16
David Wulff31-Jan-02 4:16 
AnswerRe: DELETE FROM ... not affecting the table? Pin
Andrew Peace30-Jan-02 11:35
Andrew Peace30-Jan-02 11:35 

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.