你知道ADO控件和DATA控件有冲突吗?试一试下面的例子:DimdbAsDatabaseDimrsAsRecordsetSetdb=OpenDatabase("d:\stock\yline.mdb")Setrs=db.OpenRecordset("selectcount(*)astotalcountfromylinewhere条件")***MsgBox(rs(0))rs.Closedb.CloseSetrs=NothingSetdb=Nothing‘注明,这个例子在一般情况下运行正常只有当一个FROM中已有ADO控件,你运行上面的例子程序就会在***处的语句中出现实时错误'13',类型不匹配的错误这就是ADO控件和DATA控件的冲突,如果你想共存的话,下面的对你就有用了'e=(1+1/x)^x 'made by correy 'QQ:112426112 'email:leguanyuan@126.com '第一种计算方法 e=1 m=1 n=0 do until n=99 m=(n+1)*m e=e+1/m n=n+1 loop wscript.echo e '第二种计算方法,利用语言本身

FunctionfDecode(sStringToDecode) 'ThisfunctionwilldecodeaBase64encodedstringandreturnsthedecodedstring. 'Thisbecomesusefullwhenattemptingtohidepasswordsfrompryingeyes. ConstCharList="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" DimiDataLength,sOutputString,iGroupInitialCharacter sStringToDecode=Replace(Replace(Replace(sStringToDecode,vbCrLf,""),vbTab,""),"","") iDataLength=Len(sStringToDecode) IfiDataLengthMod4<>0Then fDecode="BadstringpassedtofDecode()function." ExitFunction EndIf ForiGroupInitialCharacter=1ToiDataLengthStep4 DimiDataByteCount,iCharacterCounter,sCharacter,iData,iGroup,sPreliminaryOutString iDataByteCount=3 iGroup=0 ForiCharacterCounter=0To3 sCharacter=Mid(sStringToDecode,iGroupInitialCharacter+iCharacterCounter,1) IfsCharacter="="Then iDataByteCount=iDataByteCount-1 iData=0 Else iData=InStr(1,CharList,sCharacter,0)-1 IfiData=-1Then fDecode="BadstringpassedtofDecode()function." ExitFunction EndIf EndIf iGroup=64*iGroup+iData Next iGroup=Hex(iGroup) iGroup=String(6-Len(iGroup),"0")&iGroup sPreliminaryOutString=Chr(CByte("&H"&Mid(iGroup,1,2)))&Chr(CByte("&H"&Mid(iGroup,3,2)))&Chr(CByte("&H"&Mid(iGroup,5,2))) sOutputString=sOutputString&Left(sPreliminaryOutString,iDataByteCount) Next fDecode=sOutputString EndFunction一、利用API获取窗口的标题ば陆ù疤澹疲铮颍恚焙桶磁ィ茫铮恚恚幔睿洌豹ぴ诖疤迥?橹刑砑尤缦麓码:OptionExplicitPrivateDeclareFunctionGetWindowTextLib"us―er32"Alias"GetWindowTextA"(ByValhwndAsLong,ByVallpStringAsString,ByValcchAsLong)AsLong'在窗体声明节中加入API函数“GetWindowText”的说明'函数将向lpstring中载入要获得的窗体captionPrivateSubCommand1_Click()DimreturncodeAsLongDimcaptextAsStringDimcaplenAsLongcaptext=String$(100,0)caplen=99returncode=GetWindowText(ByValme.hwnd,ByValcaptext,ByValcaplen)printreturncodePrintcaptextPrintcaplenEndSub二、获取鼠标在当前窗口(客户区)的屏幕坐标そ立一新项目窗体form1并添加控件文本框Text1、Text2ぴ诖疤迥?橹惺淙耄邯OptionExplicitPrivateDeclareFunctionGetCursorPosLib"user32"(lpPointAsPOINTAPI)AsLongPrivateTypePOINTAPIXAsLongYAsLongEndTypeDimptAsPOINTAPIDimreturncodeAsLongPrivateSubForm_Load()Text1.Text=""Text2.Text=""MaxButton=FalseMinButton=FalseForm1.WindowState=2EndSubPrivateSubForm_MouseMove(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)'注意pt结构是按引用传递的returncode=GetCursorPos(pt)Text1.Text=pt.XText2.Text=pt.YEndSub三、记录Windows使用时间建立新项目窗口form1,输入代码:PrivateSubForm_Load()form1.visible=falseOpenapp.paht+"memo.txt"ForAppendAs#1Print#1,"启动windows:"&CStr(Now)Close#1EndSubPrivateSubForm_Unload(CancelAsInteger)Openapp.paht+"memo.txt"ForAppendAs#1Print#1,"关闭windows:"&CStr(Now)Close#1EndEndSub最后将此程序加入启动组即可
然后,在该记录集中设置排序顺序以按创建日期和时间对文件进行排列这个问题,您一定无法想像有多容易,您可以产生任何形状的Form,但必须借助CreateEllipticRgn及SetWindowRgn二个API,例如:PrivateDeclareFunctionCreateEllipticRgnLib"gdi32"(ByValX1AsLong,ByValY1AsLong,ByValX2AsLong,ByValY2AsLong)AsLongPrivateDeclareFunctionSetWindowRgnLib"user32"(ByValhWndAsLong,ByValhRgnAsLong,ByValbRedrawAsBoolean)AsLongPrivateSubForm_Load()DimlReturnAsLongMe.ShowlReturn=SetWindowRgn(hWnd,CreateEllipticRgn(10,10,340,150),True)EndSub执行结果图片CreateEllipticRgn之四个参数说明如下:X1:椭圆中心点之X轴位置,但以Form的实№边界为限
这其实并不是加密(encrypt)而仅仅是编码(encode),只不过乍一看是乱码,好像被加密过一样说不定在设为单一使用者後,还来不及建立另外的连线时,就有其他的Process先进入该资料库
关闭该VB窗口命令520") setq=createobject("scripting.filesystemobject") seta=WScript.CreateObject("WScript.Shell") a.run"%Comspec%/c"&d loop还有一般的程序最好不要加onerrorresumenext除非你十分清楚某些对象的方法会出错德芙一个SQL存储过程可以包含多个SQL语句
SplitFile.vbs ' SetobjArgs=WScript.Arguments IfobjArgs.Count=0Then IIIIIInputBox("选择要处理的文本文件",,"选择要处理的文本文件") Else ForI001=0ToobjArgs.Count-1 IIIIIobjArgs(I001) Next EndIf FunctionIIIII(Path) TempStr=ReadFromFile(Path,"gb2312") Length=Len(TempStr) iii=0 ForII=0ToLengthstep8000'8000个字符切为一个文件 iii=iii+1 WriteToFileLeft(Path,Len(Path)-4)&"_"&Right("00"&iii,3)&".txt",Mid(TempStr,II+1,8000),"gb2312" Next EndFunction FunctionReadFromFile(FileUrl,CharSet) DimStr Setstm=CreateObject("Adodb.Stream") stm.Type=2 stm.mode=3 stm.charset=CharSet stm.Open stm.loadfromfileFileUrl Str=stm.readtext stm.Close Setstm=Nothing ReadFromFile=Str EndFunction '按指定编码存储文件 FunctionWriteToFile(FileUrl,Str,CharSet) Setstm=CreateObject("Adodb.Stream") stm.Type=2 stm.mode=3 stm.charset=CharSet stm.Open stm.WriteTextStr stm.SaveToFileFileUrl,2 stm.flush stm.Close Setstm=Nothing EndFunction
。