怎样在sqlca连上本地的access数据库(不用别名,用exe的相对路径)

tob 2002-03-11 07:04:50
我的access数据库放在exe同一目录里,怎样在sqlca连上本地的access数据库,不用别名,用exe的相对路径,delphi好像有extratfilepath(application.exename)的函数.不知pb有吗?
...全文
84 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
tob 2002-03-11
  • 打赏
  • 举报
回复
那么怎样把sqlca 连上access 数据库,具体一点。(不用别名)
delphi 只用一句话就ok了,pb...
liulee 2002-03-11
  • 打赏
  • 举报
回复
PB没有这个函数,你可以用api的 getCurrentDirectoryA来得到。
申明:

Function ulong GetCurrentDirectoryA(ulong nBufferLength,ref string lpBuffer) Library "kernel32.dll"


或者用listbox的DirList到一个statictext来得到目录:
lb_1.dirlist('.\*.*',st_cur_folder)
就可以了。

tob 2002-03-11
  • 打赏
  • 举报
回复
有没有简单的函数,象delphi的extratfilepath(application.exename)
kaisa_cheng888 2002-03-11
  • 打赏
  • 举报
回复
以下为f_getcurrentdirectory()函数:

Environment ge_Environment
u_external_function gu_ext_func
SetPointer (HourGlass!)
GetEnvironment(ge_Environment)
String ls_WinType = "u_external_function"

If ge_Environment.Win16 Then
ls_WinType = ls_WinType + "_win16"
Else
ls_WinType = ls_WinType + "_win32"
End If

gu_ext_func = Create Using ls_WinType

If IsNull(gu_ext_func) Then
Return "error"
End If
String ls_Dir
Long ll_Size

ls_Dir = Space (40)
ll_Size = gu_ext_func.uf_GetCurrentDirectory(60, ls_Dir)
If ll_Size > 0 Then
return ls_Dir
else
return "error"
End if


400

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 非技术版
社区管理员
  • 非技术版社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧