| 发表于:2007-10-20 00:40:55 楼主 |
让vb程序开机自动运行,却提示“c:\documents and settings\user\中找不到数据库”,求救! 我的这个程序主要是vb+access+adodc 我的这个软件又不是装在“c:\documents and settings\user\”下,怎么会这样提示呢? 哪位大哥帮帮忙?谢谢先!!! 该部分原程序如下: private declare function regsetvalue lib "advapi32.dll" alias "regsetvaluea" (byval hkey as long, byval lpsubkey as string, byval dwtype as long, byval lpdata as string, byval cbdata as long) as long private declare function regcreatekey lib "advapi32.dll" alias "regcreatekeya" (byval hkey as long, byval lpsubkey as string, phkresult as long) as long private declare function regclosekey lib "advapi32.dll" (byval hkey as long) as long private declare function regdeletevalue lib "advapi32.dll" alias "regdeletevaluea" (byval hkey as long, byval lpsubkey as string) as long private const hkey_local_machine = &h80000002 private const reg_sz = 1 dim strstring as string dim keyhand as long strstring = app.path & "\" & app.exename & ".exe" regcreatekey hkey_local_machine, "software\microsoft\windows\currentversion\run", keyhand regsetvalue keyhand, "", reg_sz, byval strstring, lenb(strconv(strstring, vbfromunicode)) + 1 regclosekey keyhand open "calendar2" for output as #1 write #1, "true" close #1 |
|
|
|
|