Get Number Of A Type Of Files From FSO
I was just wondering if there is a way to get a file count from the FSO of a certain type of file without doing it manually. For instance, I'm trying to copy all files of a certain type from a remote folder. I want to know their quantity so that I can set the max value of a progress bar. I'm using the getFolder method of the FileSystemObject to set a FolderObject. The FO has a property called files.count, but I don't know how to filter out the files I don't want. Thank you for any help, and, please, no FileSystemObject rants ;P
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
10K, 5M Type Number Formats
I know I saw this in here somewhere before. I'd like to be able to have numbers in the thousands (e.g. 10,000, 15,000 etc.) show up like 10K, 15K, etc. and numbers in the millions show up like 1M, 2M, 10M etc.
I know someone came up with a solution to this problem on here, but I couldn't find it. Can anyone help me so I don't have to recreate the wheel?
Convert To Type Number
I have a double and need to convert it to type number to insert it to the database. Can anyone help? Thanks
Files Older Than 16 Days, Number Of Files In A Folder
I am trying to come up with a way to write a script that will do the following,
Identify which subdirectories have files in them older than 16 days, and subdirectories that have more than two files in them.
Then I need to log these directories to a log for review.
I would also like for this VB Script to exclude a couple of the subdirectories in a folder that I am searching.
Can you assist me in writing this?
Data Type - Integer To Number
Ok I am having trouble querying my database with a user entered value.
The user enters and ID no. in a text field which is then cast to an Integer to be safe:
'Check if the user entered a reservation number to search from
If (ReservationNumberField.Text <> "") Then
'Check if what was entered was actually a number
If IsNumeric(ReservationNumberField.Text) = True Then
iReservationNum = CInt(ReservationNumberField.Text)
Then iReservationNum is passed to a method which accesses the database and executes an SQL query on a table. The Reservation Number is the primary key of this table and as a result is stored as an "autonumber"....upon running the query I get a "data type mismatch" error:
"SELECT * FROM reservation WHERE reservationID = '" & reservationNum & "' "
I assume this is because I am looking for an Integer in a column of "autonumbers".....
What do I do??
Thanks!
Edit: Oh...I did do a search first, couldn't find anything
Type Mismatch - Error Number 13
I am getting a type mismatch error on the following code:
VB Code:
Set qdSingleBatch = pubDbBatch.QueryDefs("SingleBatch")qdSingleBatch.Parameters("[Transaction Type:]") = frmBatchHeaderCard.mebTransactionTypeqdSingleBatch.Parameters("[Batch Number:]") = frmBatchHeaderCard.mebBatchNumberSet rsBatchDetail = qdSingleBatch.OpenRecordset(dbOpenDynaset)
Any ideas what might be causing this???
Long Number Data Type
Hey all (again, sorry for all the questions ^^;; )
I'm just wondering if there's a data type or if one can be made for storing very long numbers, but being able to perform mathmatical calculations on them? (i.e. not a string).
I want to use the Rnd function to generate a 20-digit number, e.g. 40229603967719402863. I can't store it int/long/etc as it's too long, I can store it in Double but then it makes it a floating point number.
Soo.. Any way to generate a number of this size and have it display the full value? I'm trying to generate a unique ID, you see
Number Data Type In SQL Statement
Hi all..
Below is my code snippet:
VB Code:
rsShop.Open "SELECT * FROM RATE_DATA WHERE MC_NO = '" & text1.Text & "'", conn, adOpenKeyset, adLockOptimistic
i have error "Data type mismatch"
in MS Access the data type for the MC_NO is number, i think maybe the data type is not match with my SQL statement.
What is the right syntax to capture number data type in SQL statement?
Thanks.
Comparing Int From Vb With Number Data Type In RS
Hi, I'm getting an error trying to compare an integer variable with a number in my database....
this is my sql statement
.Open "SELECT * FROM GRADE INNER JOIN EMPLOYEE ON GRADE.GRADE_ID = EMPLOYEE.GRADE_ID WHERE EMPLOYEE.EMP_ID= '" & intEmpID & "'", cnEmployee, adOpenStatic, adLockOptimistic, adCmdText
can someone help please...mucho appreciated!
Number Of Entries In Enum Type
Is there any way to find out the number of entries in a enum type ?
For example:
if I have a enum definition in a program:
enum Holidays
NewYear
XMas
Easter
end enum
during run time, how can the number of entries of Holidays be obtained without explicitly count by the programmer, such that
intCout = number of entries in Holidays (of course, we know it is 3, but I don't want to count and write down the number by myself, such as
redim Array(intCount)
Is this lazy way possible ?
Monitor Serial Number && Type
Hi there all !
I 've been wondering during these last days if there is a way to get the Serial Number and Type from my monitor (Avoiding turning it back, sure :-)) and I tried using the WMI with its Win32_DesktopMonitor class with no success, well I am able to get the Manufacturer only. Later I used the PNPDeviceID value returned to search on the registry but it is empty. I searched google but nothing regarding Monitor was found, just CPU serials, motherboards..
I finally decline but using the Dr Hardware I was surprised to see it was able to detect it all , even ¡ the year of manufacturer !
So I think there should be a way.....Could any of you help me ?
Thanks and Regards,
Count Number Of Characters In Text Box As I Type
Hi All,
Probably a very easy solution to this, but I am new to VBA. Using an unbound text box in Access how do I count down the number of characters left in another text box as I type. i need this as as we all know a textbox has a 255 character limit.
I know the formula is [textbox1].value=255-Len([textbox2]) but i can only get this to fire once. I have tried looping but the program freezes.
I have tried this with all of the events eg keydown, keyup, change but still it will only fire once. your help would be appreciated
How To Count Number Of Letters As I Type It Textbox
hi all. could any one show me how i can count the number of letters as i type them in textbox. Also if i paste a sentence and press a button it shows the number of letters for me.Thanks
Note: i want to count space too.
Can't Access Number Data Type Using Ado Pl Help Urgent
I am using Ado control. When i am retriving the database from the Oracle i am unable retrive the data where the data type is Number. But other data types i am able retrive.
Here is the following code i used.
Dim cn As New ADODB.Connection
Dim ConStr As String
Const ConnectString = "uid=scott;pwd=tiger;dsn=TempProc;,,connection=adConnectAsync"
cn.Open (ConnectString)
Dim proc_sh_rs As ADODB.Recordset
Set proc_sh_rs = New ADODB.Recordset
Dim sql As String
sql = "Select * from PROC_SHEET"
Set proc_sh_rs = cn.Execute(sql)
Do Until proc_sh_rs.EOF
Set proc1 = New Process_Sheet
MsgBox (proc_sh_rs("PROC_SHNO"))
MsgBox proc_sh_rs("PDATE")proc_sh_rs.MoveNext
Loop
Any kind help is Appericiated.
-Reddy
How To Round The Number For String Data Type Field Name?
I have problem here, I used text data type for all these field name. I don't know how to round these number. I got 3.4189189.. after calculating the value. How I can round these number to be like this 3.412 ?
Code:
Fields("Hasil Kasar (kg)").Value = Text2.Text
Text3.Text = Val(Text2.Text) / 1000 / Label10.Caption
.Fields("Purata Hasil Kasar (Tan/ha)").Value = Text3.Text
Text4.Text = Text2.Text - (Text2.Text * 17) / 100
.Fields("Hasil Bersih (-17 %)").Value = Text4.Text
Text5.Text = Text3.Text - (Text3.Text * 17) / 100
.Fields("Purata Hasil Bersih (Tan/ha)").Value = Text5.Text
SQL QUERY HELP(currency/Number Data Type Ms Access)
hi guys... can you help me regarding a sql query... im using ado and msacess as database
VB Code:
Dim KT_sss As New RecordsetDim lv_sql1 As StringDim lv_whole As Double lv_whole = 13000 lv_sql1 = "select * from sss"lv_sql1 = lv_sql1 + " where sal_credit <= " & lv_whole & "" Set KT_sss = New Recordset KT_sss.Open lv_sql1, gd_local, adOpenStatic, adLockOptimistic
sal_credit field is declared as currency data type in my msaccess database.. my error is too few parameters expected... how can i solve this?...
thanks in advance........
Invalid Use Of NULL (when Feild Data Type Is Number)
I am using VB 6.0 , Oracle 8.1.6 and win 2000 in my home
Follwing is hte description of my table
STUDENT_ID NOT NULL NUMBER(6)
SUBJECT_ID NOT NULL VARCHAR2(3)
MARKS_OBT NUMBER(5,2)
TERM_ID NOT NULL NUMBER(2)
DATE_EXAM DATE
GRADE VARCHAR2(2)
Now
qry = "select marks_obt,grade from exam_result where student_id = 105903 and subject_id= 'MAT' and term_id = 1 and TO_NUMBER(TO_CHAR(date_exam, 'fmMM')) = 8
Now for this record the marks_obt is Null
If rs1.Fields(0).Value = "NULL" Then
marks = "A"
Else
marks = rs1.Fields(0).Value
End If
it Give me Error "Invalid Use of NULL"
when Debugged, the If rs1.Fields(0).Value = "NULL" is false and come to the Else part.
I've tried
If rs1.Fields(0).Value = "Null" Then
If rs1.Fields(0).Value = Null Then
If rs1.Fields(0).Value = "" Then
but no use
In case if there is a feild with datatype varchar2( similar to varchar in SQL)
If rs1.Fields(0).Value = "" Then
works fine if rs1.Fields(0).Value is NULL
All I want when my Feild marks_obt (look at the query in the beginning) is NULL do some action and otherwise do dome other actions....
Data Type Number, Field Size Decimal
Hi,
I have an Access database where I retrieve the salary of an employee and the data type is decimal. When I read in the field (VB), using an adobc recordset, if the value ends in a zero, sometimes the zero is dropped. For example I read in 20000 and I read in and print 2000.
I have to use this database. How do I read in the value without dropping the zero?
Thanx,
Donna
What Is The Proper Data Type To Store Binary Eqiv. Of A Number In An Array?
Hello all,
Trying to figure out the proper way to store the Binary representation of a number in an array. Numbers range from 0 to 65,535, and each number represented (after conversion) by 16 individual bits. Currently I am doing the following;
Code:
'Array to hold bit representation of a Number
dim bytBits(15) as byte
Private sub ConvertToBinary(ByVal x As Long)
Dim i as Byte[indent]for i = 0 to 15
if x and 2^i then bytBits(i) = 1 else bytBits(i) = 0
Next i[/indent]end sub
So in the above, each byte holds 1 bit. This is a waste of memeory space if I were to hold 50 number conversions in memory. It is important that I have access to individual bit values elsewhere in my program. Any thoughts and ideas on how to conserve memory and still accomplish the above?
Thanks
Files Type
if i have a variable of the type files, which contained it in is something like
(Locals window)
+variable files
count 4 integer
+ item 1 file
+ item 2 file
+ item 3 file
+ item 4 file
how do i access each item....
dim temp as file
temp = variable.item(1) does not work!
SQL With Different Type Files
I would like to create a SELECT query from several files - DBFs and MDBs. How can I do this? I have connections defined for both but I don't know how to describe databases in SELECT command.
Or, if it's easier, may I have a SELECT query with
"FROM dbfFreeTable"
and
"INTO mdbDatabaseTable"
?
If I can use SELECT to move records from DBF into a MDB I will join data inside the MDB file.
Thanks for help. I would be glad even anybody can give me a link with detailed information in this area. I couldn't find any.
Anca
Copying Files Of A Type
For future use I am attempting to put together a program that will copy all essential files from my Hard Drive to an External 120 GIG. What I am looking to do is to automatically copy all .jpg files from my C: drive to my external. I need a program that will search my entire C: drive and then move the files.
To be honest, I am new to the VB6 world. I have purchased some books for required reading and I am eager to learn.
Can someone please point me in the right direction
Thankyou
Viewing Various Files Of Different Type
Hi,
I have an application where in there are files of different type associated
with various topics. I list the topics in a grid control with details of the
same, when I click on any of this topic names the respecitve files should
open. How could it be achieved( few formats are
xls,doc,txt,html,rtf,ppt,swf,some CAD drawings , gifs, jpgs, bmps etc ), not
sure of any other type ( could be all possible file types).
Regards
Hemant
How To Get The Files Content-type In Vb6
In IIS, each files are haven the property named content-type
example:
jpg files: aaa.jpg its content-type is "image/jpeg"
gif files: bbb.gif content-type is "image/gif"
xml files ccc.xml content-typeis "text/xml"
then
in vb6, how to get the files content-type?
use Adodb.Stream? then read the files buffer?
or use API to get files content-type?
who can help me? pls, ths.
What Type Of Files Needed During Intall
Hello to ALL
I'm using Inno Set up Programm. All is Ok But the Rada Report is Not Running. Please Guide me the names of Files that are needed to run Data Report. the Error msg is
"VB run Time Error '713' Application-Defined Or Object Defined error"
This prgramm is running on the PC where Vb is Install but not any other PC.
PLease Help me as soon As possible:wall:
Dynamic Type And Random Files
Here is a challenge I am struggling with:
I need to save personal types in random files, my problem beeing when I start the app, I do not know lenght of type...
Let me explain:
I need to save survey files
a survey may hold 100, 200 even 1000 questions or more
each question can have form 2 to 10 or twenty possible answers.
I need to buils questionnaire one one hand and then save filled questionnaires on the other...
Any ideas ????
Moving Files Of A Certian Type?
Hey all,
Im making a program to sort through a directory of many different files and filter them into different directories according to their file type.
How would I go around telling VB to move, for example all the .mp3 files to a certian directory? I think I can get the destination directory bit, its just selecting all the files and moving them that's the problem at the moment.
Thanks for any help,
Paul
Openig Files Of Unknown Type
How do i open files in VB of unknown types? i'm sure they are not text files coz they can't be open using text editors.
pls help
User Defined Type Files
I have to User defined files. THe old one is 80 bytes and the new 1 is 84 bytes. I want to convert the old existing records based on the old 80 byte files into New 84 byte files. Can anyone show me an example of how I can do this. I ve trieed to use 2 open Random statements, 1 for read and 1 for write but I couldn't get it to work?
Clipboard Data Type For .wav Files
What data type is a .wav file when it is on the clipboard? I find these data types in the help file for VB:
vbCFLink Dynamic data exchange link.
vbCFText Text.
vbCFBitmap Bitmap.
vbCFMetafile Metafile.
vbCFDIB Device-independent bitmap.
vbCFPalette Color palette.
When I copy a sound clip from Sound Recorder to the clipboard, then check the data format using GetFormat(), I get a TRUE result from vbCFBitmap, vbCFMetafile, and vbCFDIB. Is this the correct way to determine a .wav data type on the clipboard?
Finding All Files Of Certin Type?
Ok...My goal is to grab all the files with an extension like .exe. I am using a Dir list box and a File list box. What I want to do it go through every folder and sub folder starting at C: and grab every .exe out of the file list box as it goes. I was thinking of like starting with the first folder and going all the way to the lowest sub folder and then working its way back up, going through every folder possible. How could this be done? Maybe something like... dir.path = dir.list(dir.listcount - dir.index) or something like that. I dunno....How would I do it...any ideas? Anything..Even not using listboxes would be good...just give me the best way to do it. thanks in advance.
Finding All Files Of A Certain Type In A Folder
How can I get a VB program to find all files with a specific file extension in a folder and then have the program perform some action on each of these files?
for example, if I wanted to find all the *.zip files in the My Documents folder and then search through their contents for a given filename.
Search All Drives For Files Of A Particular Type? (MP3)
I am writing a mass MP3 tag editor program, I want it to ba able to search All Local and networked drives (or drives specified by the user) for files ending in .mp3, then as it finds each file load the file info into an MSFlexGrid. Howe do I contiuously search for files untill all disks have been searched? I saw a few threads simmilar to this but none had the answer I needed.
Tell me, and i will forget...
show me, and I will remember...
Involve me, and I will learn...
-Karaethon
me: http://ffxi.allakhazam.com/profile.xml?45524
Edited by - Karaethon on 9/1/2004 11:48:18 AM
Counting Number Of Files
I want to create a script that obtains the number of files in a folder - it must also search any subfolders in this directory. IE:
C:shizzle may have subfolders metimbers and fosho etc
Any help? smiley Much Virtual beers n vallies in it for ya!
Total Number Of DAT Files.
Hey! I have a folder with a whole bunch of .DAT files in it. Does anyone know how I can count these and add the total to a variable? The number of files changes all the time.
Thanks!
Number Of Files In Folder API
Hi,
I just wonder if there's a way to retrieve the number of objects in a folder using API. I know I can do so by just counting the objects in the folder.
I just want to know if there's another way
Please Help: Reading A Number Of Files One After Another
Hi
I am working with VB6 and need some help please. Using some code, I generated a number of files, stored somewhere on my hard drive. I know how to read just one of those files, hard-called by name, e.g. "file1.txt". Now the problem is, how do I read each of those files, one at a time ?
Assume that the files are "file1.txt" upto "file10.txt", i.e 10 files. ---never mind which line within the file is being read--that is taken care of -- I just need to know how to read each file, one after the other. Thanks.
Frankly747.
Decoding A Number Of Files In A Row
I have used this program to encode four files. I need to decode all four files at the beginning of the application. I know I can do one file but is it possible to decode all four one after the other?
Code:
Sub FileEncodeAndDecode(InputFile As String, OutputFile As String, PasswordKey As String)
Dim temp As Single
Dim Char As String * 1
Dim XORMask As Single
Dim temp1 As Integer
Open InputFile For Binary As #1
Open OutputFile For Binary As #2
For x = 1 To Len(PasswordKey)
temp = Asc(Mid$(PasswordKey, x, 1))
For y = 1 To temp
temp1 = Rnd
Next y
' Re-seed to throw off prying eyes
Randomize temp1
Next x
Counter = 0
For z = 1 To FileLen(InputFile)
'Generate random mask
XORMask = Int(Rnd * 256)
'Get the char & change it
Get 1, , Char
Char = Chr$((Asc(Char) Xor XORMask))
Put 2, , Char
Counter = Counter + 1
If Counter > Len(PasswordKey) Then Counter = 1
' Pull random numbers from the hat
For x = 1 To (Asc(Mid$(PasswordKey, Counter, 1)) * 2)
temp = Rnd
Next x
Next z
Close #1
Close #2
End Sub
Private Sub Command1_Click()
Dim InputFile As String
Dim OutputFile As String
Dim PasswordKey As String
' InputFile = InputBox("Enter a filename to encode")
' OutputFile = InputBox("Enter the new filename this will become ")
' PasswordKey = InputBox("Enter the password (key)")
InputFile = ".txt"
OutputFile = ".txt"
PasswordKey = ""
Call FileEncodeAndDecode(InputFile, OutputFile, PasswordKey)
MsgBox "File written to " + OutputFile
End
End Sub
Private Sub Form_Load()
Command1.Caption = "Code/Decode"
End Sub
How To Download A Number Of Files Respectively ?
Ok this is getting a bit tricky, i want to be able to download a bunch of files that i have in a list box, client/server setup.
so far i have,
VB Code:
Dim i As Integer For i = 0 To List1.ListCount - 1 With objcommondialog .FileName = List1.List(i) Open .FileName For Binary As #1 End With bFileTransfer = True Next i End Sub
ok this works fine for the first item(file) thats been put into the list box but when it comes round to download loading the second file in the list box i get, 'error 55 file already open' ?
any thoughts ?
Counting The Number Of Files
Dear vb users,
I have got information to get the number of files with the next code:
Dim objFS As FileSystemObject
Dim objFolder As Folder
Set objFS = New FileSystemObject
Set objFolder = objFS.GetFolder("C: emp")
MsgBox "File Count: " & objFolder.Files.Count
With this code you are counting all files in this directory. Can someone please give me code to find the number, for example, of *.pdf files.
Nice regards,
Michelle.
Number Of Files In A Directory
Help please,
Is there an easy way to count how many files are in a certain directory, with a specific file extension. Im gona be storing them in a list box.
Thanks in advance
How To Get The Number Of Files Currently In A Directory?????
Does anyone know how I can determine how many files are currently in a directory. I need to make sure I am not copying more files than the user defined limit to a particular directory. Throughout my program, I am using the file system object but I can't see a way.
Any ideas?????
Thanks,
M
How Do I Get A Files Version Number?
How can you check the version number of a specific file without running that program. I need to get the acutal version number comparing file sizes wont work.
Thanks in Advance
Mr. Wizard
Max Number Of Files Open !?!?!
Can anyone tell me why, when I try and open a recrodset on rs1, I get the message 'HASH_MAX_OPEN_FILES LIMITATION' ?
This is my code :
***********************************************
LookupKey = "1" & Dep(ItemCount) & Cat(ItemCount) & SBC(ItemCount) & Item(ItemCount)
cmd.CommandText = "select RMPO_ORN from RMORDR where RMPO_HED = '" & LookupKey & "' and RMPO_DLV = '0' ; "
rs.Open cmd, , adOpenDynamic, adLockReadOnly
OrderFound = False
Do While Not rs.EOF
For m = 0 To NumberofOrders
If OrderNumber(m) = rs.Fields(0) Then
OrderFound = True
End If
Next m
If Not OrderFound Then
OrderOK = False
OrderNo = rs.Fields(0)
cmd.CommandText = "select RMPO_DEL from RMORDR where RMPO_NUM = ('" & OrderNo & "' & '0000000') ; "
rs1.Open cmd, , adOpenDynamic, adLockReadOnly
***********************************************
I can't find any help in MSDN.
Number Of Files In A Directory
I have been searching this forum for an answer, but couldn't find any. I'm trying to get the total amount of files in a specific directory. I only know the path of the directory, I don't know anything about the files inside the directory. Then I want the application to randomly select one of these files (= photos) to show it in a picturebox.
Can anyone help me?
Thanks in advance,
Dave.
|