|
-
Jan 23rd, 2005, 08:13 PM
#1
Thread Starter
New Member
Problem Creating Files
Hello,
Is there a limit of to the number of files you can create in a folder on Win XP Pro SP2. I am trying to create 25,000 files that are about 2-7kb. When i run my program only 111 files are created. I have include the major part of the program. Can any body see what I am doing wrong?
Thanks,
Medianutz
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
Dim CNkeywords As ADODB.Connection
Dim RSkeywords As ADODB.Recordset
CNkeywords = New ADODB.Connection
CNkeywords.ConnectionString = ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=kw.mdb")
CNkeywords.Open()
Dim count As Integer
Dim strSQl As String
Dim I As Integer
Dim page As String
Dim place As String
Dim c As Integer
place = "C:\kwdata"
System.IO.Directory.CreateDirectory(place)
I = 0
c = 0
strSQl = "SELECT * FROM keywords" ' where date is null" '< '" & Today & "'"
RSkeywords = New ADODB.Recordset
RSkeywords.ActiveConnection = CNkeywords
RSkeywords.CursorType = ADODB.CursorTypeEnum.adOpenStatic
RSkeywords.LockType = ADODB.LockTypeEnum.adLockOptimistic
RSkeywords.Open(strSQl)
count = RSkeywords.RecordCount
Do While c <= count
page = Replace(RSkeywords.Fields("keyword").Value(), " ", "_") & ".asp"
createfile(RSkeywords.Fields("keyword").Value(), place & "\" & page)
TextBox1.Text = TextBox1.Text & RSkeywords.Fields("keyword").Value() & ", "
c = c + 1
Label2.Text = c
RSkeywords.Fields("date").Value() = Today
RSkeywords.Update()
RSkeywords.MoveNext()
Loop
RSkeywords.Close()
CNkeywords.Close()
CNkeywords = Nothing
End Sub
Function createfile(ByVal kw As String, ByVal location As String)
Dim oFile As System.IO.File
Dim oWrite As System.IO.StreamWriter
oWrite = oFile.CreateText(location)
oWrite.WriteLine("<html><head>")
oWrite.WriteLine("<title>" & kw & "</title>")
oWrite.WriteLine("<meta name='keywords' content='" & getkw(kw) & "'>")
oWrite.WriteLine("<meta name='description' content='" & getkw(kw) & "'>")
oWrite.WriteLine("</head><body>")
oWrite.WriteLine("<table border=1>")
oWrite.WriteLine("<tr>")
oWrite.WriteLine("<td>")
oWrite.WriteLine(getlinks(kw))
oWrite.WriteLine("</td>")
oWrite.WriteLine("<td>")
oWrite.WriteLine("</td>")
oWrite.WriteLine("</table>")
oWrite.WriteLine("</body></html>")
oWrite.Close()
End Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|