vb 读取指定路径文件名
Private Sub ExportCostSheetData()
InsertRow("")
InsertRow("Run 2:Export CostingSheet=========================")
InsertRow("Status:System Connectting DataBase!")
If ConnJWeb() = False Or ConnJWeb2() = False Then
InsertRow("Status:System Connectting DataBase fialed!")
AddRow("", "", "Status:System Connectting DataBase fialed!", "system")
Exit Sub
' GoTo End1
End If
Dim CurrentComp As Integer
Dim strDestFolder As String = "\\1.1.1.1\BogartCosting\CostSheet\"
Dim rsR As New ADODB.Recordset
Dim Flag As String = selectValue(" select top 1 flag from CostingSheetFileInfo ", adoJWeb, )
Try Dim strFiles() As String = Directory.GetFiles(strDestFolder)
Dim strFile As String
Dim AbsolutePath As String
Dim strFilePresent As String rsR.Open("select * from CostingSheetFileInfo ", adoJWeb, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic)
For Each strFile In strFiles
strFilePresent = Path.GetFileName(strFile)
AbsolutePath = strDestFolder & strFilePresent
Dim netCmd As New OleDb.OleDbCommand("P_DeleteRecord", netJWeb)
netCmd.CommandType = CommandType.StoredProcedure
netCmd.Parameters.Add("@FileName", strFilePresent)
netCmd.Parameters.Add("@FileType", "Complete Costing")
netCmd.ExecuteNonQuery()
rsR.AddNew()
rsR.Fields("FileName").Value = strFilePresent
rsR.Fields("FileType").Value = "Complete Costing"
rsR.Fields("AbsolutePath").Value = AbsolutePath
rsR.Fields("LastUpdateDate").Value = Now()
rsR.Fields("Flag").Value = IIf(Flag = , "", "")
rsR.Update()
InsertRow(strFilePresent & "===OK!")
CurrentComp = CurrentComp +
Me.ProgressBar1.Value = (CurrentComp / strFiles.Length) *
Next
rsR.Close()
Catch ex As Exception
SendEmail()
InsertRow("===Open Folder Fail===")
InsertRow("End Time:" & Now)
Exit Sub
End Try adoJWeb.Execute("Update CostingSheetFileInfo set flag='" & IIf(Flag = , "", "") & "' where flag is null ")
adoJWeb.Execute(" delete from CostingSheetFileInfo where flag='" & Flag & "'")
' InsertRow(" Total error records:" & strFiles.r & "")
InsertRow("")
InsertRow("***************** System export result *******************") InsertRow("")
InsertRow("End Time:" & Now)
InsertRow("***************************************************************") End Sub
vb 读取指定路径文件名的更多相关文章
- 读取指定路径的Properties文件
1.读取项目内的properties文件,项目内的properties文件一般都放在resource文件夹下面, 通过getClassLoader().getResourceAsStream()来获取 ...
- matlab读取指定路径下的图像
利用matlab读取指定路径下的图像 %% 读入指定路径imgFolder下的图像imgName imgFolder = 'F:\博\快盘\图像+数据\images\文章实验图'; %指定路径 img ...
- Eclipse直接运行算法第4版例子(重定向和读取指定路径文件)
Eclipse直接运行算法第4版例子(重定向和读取指定路径文件) 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://b ...
- [C#]读取指定路径的配置文件[转]
ExeConfigurationFileMap map = new ExeConfigurationFileMap(); map.ExeConfigFilename = @"C:\App.c ...
- C#读取指定路径下的Config配置文件
ExeConfigurationFileMap map = new ExeConfigurationFileMap(); map.ExeConfigFilename = @"F:\App1. ...
- Java 读取指定目录下的文件名和目录名
需求:读取指定目录下的文件名和目录名 实现如下: package com.test.common.util; import java.io.File; public class ReadFile { ...
- MATLAB检查指定路径中的子文件夹中的文件名中是否带有空格
测试文件夹为: clear;close all;clc; %% %程序实现的功能 %检查指定路径中的子文件夹中的文件名中是否带有空格,并去掉文件名中的空格 %% %程序中用到的之前不清楚的函数如下 % ...
- Python--通过索引excel表将文件进行文件夹分类的脚本+读取指定目录下所有文件名的脚本
1.通过索引excel表将文件进行文件夹分类的脚本,此脚本由于将ip和id对应并生成对应id的文件夹将文件进行分类,也可以任意规定表格内容,通过vul_sc_ip.txt和xlsx文件进行索引. # ...
- C#查找指定路径下的所有指定文件,并读取
string path="指定路径"; string filename =“需要查找的文件名.csv"; List<string> lineStringLis ...
随机推荐
- [LeetCode&Python] Problem 908. Smallest Range I
Given an array A of integers, for each integer A[i] we may choose any x with -K <= x <= K, and ...
- [LeetCode&Python] Problem 867. Transpose Matrix
Given a matrix A, return the transpose of A. The transpose of a matrix is the matrix flipped over it ...
- mvc之URL篇
一.根据路由系统生成友好的URL ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName); 会根据当前的路 ...
- 时间操作(JavaScript版)—年月日三级联动(默认显示系统时间)
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/wangshuxuncom/article/details/35263317 这个功能 ...
- 八、面向对象模型(用例图,序列图,类图,生成Java源代码及Java源代码生成类图)
面向对象模型 面向对象模型是利用UML(统一建模语言)的图形来描述系统结构的模型,它从不同角度实现系统的工作状态.这些图形有助于用户,管理人员,系统分析人员,开发人员,测试人员和其他人员之间进行信息交 ...
- Why my setting does not work?
lab mypc server7000 -> 5900 1080 -> 10800 10800 -> inter ...
- 优化Django ORM中的性能问题(含prefetch_related 和 select_related)
Django是个好工具,使用的很广泛. 在应用比较小的时候,会觉得它很快,但是随着应用复杂和壮大,就显得没那么高效了.当你了解所用的Web框架一些内部机制之后,才能写成比较高效的代码. 怎么查问题 W ...
- Jupyter和IPython
Jupyter内核就是IPython(Interactive Python):你看到的按tab键能够自动提示/补齐都是IPython实现的. IPython其实不只限于IPython,其实你看到的ID ...
- vuex基本熟悉与使用
vuex的入门与使用讲解 官网:https://vuex.vuejs.org/zh/guide/state.html 定义:Vuex 是一个专为 Vue.js 应用程序开发的状态管理模式.它采用集中式 ...
- shell 前台进程组的选择
控制命令如ctrl+c,ctrl+d等命令是会kill到前台进程组的,这个过程和bash进程还有tty驱动有关系. 在终端执行命令,在bash进程看来都是在执行job,然后fork出子进程来执行这些j ...