我的ini文件是这样配置的
[ConnStr]
ServerPath_1 = winxpensqlmk
Pass_1 = haier_2012
UserName_1 = sa
DBName_1 = Z100ServerPath_2 = winxpensqlmk
Pass_2 = haier_2012
UserName_2 = sa
DBName_2 = Z100_2
[Common]
UpdateCount = 100要实现打开数据库对个表格进行操作,,请问我该怎么做啊,,,,求大神指点~ T-T。。
[ConnStr]
ServerPath_1 = winxpensqlmk
Pass_1 = haier_2012
UserName_1 = sa
DBName_1 = Z100ServerPath_2 = winxpensqlmk
Pass_2 = haier_2012
UserName_2 = sa
DBName_2 = Z100_2
[Common]
UpdateCount = 100要实现打开数据库对个表格进行操作,,请问我该怎么做啊,,,,求大神指点~ T-T。。
解决方案 »
- 请问怎样才能加在INET控件?
- 请教一个语法问题!!谢,在线等
- VB,DOTNET,水晶报表8.0,打包出现的问题!!
- VB 如何调用 ACCESS 的“同步复制—>创建副本”功能?
- 在VB程序中删除Excel中的一个sheet,总是会报"是否永久删除"的Message,怎么去掉?
- 我一直想解决的问题(关于构造函数)
- 请问:如何得到PictureBox控健中所设定的图片的名字.
- vb xmlhttp 参数问题 网站获取参数是乱码 在线等待
- 怎样把一个exe文件做成server,好象jrun一样(指的是:控制面板->管理工具->服务)
- vb 中怎么把开始菜单屏蔽
- VB 读取SQL中两张表,将对比结果写入第三张表
- vbZ中用什么控件可以实现这种GRID里带书状的结构?
Declare Function GetPrivateProfileString _
Lib "kernel32" _
Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, _
ByVal lpKeyName As Any, _
ByVal lpDefault As String, _
ByVal lpReturnedString As String, _
ByVal nSize As Long, _
ByVal lpFileName As String) As Long
Declare Function WritePrivateProfileString _
Lib "kernel32" _
Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, _
ByVal lpKeyName As Any, _
ByVal lpString As Any, _
ByVal lpFileName As String) As Long'Read iniFile
Public Function Getini(nApp As String, nKey As String, nDefault As String, nFilePath As String) As String
Dim nStr As String, nSize As Long, s As Long nSize = 1024
nStr = String(nSize, 0)
s = GetPrivateProfileString(nApp, nKey, nDefault, nStr, nSize, nFilePath) 'GetSet = Left(nStr, S)
s = InStr(nStr, vbNullChar & vbNullChar) If s > 0 Then
Getini = Left(nStr, s - 1)
End IfEnd Function
'Write iniFile
Sub Writeini(nApp As String, nKey As String, nValue As String, nFilePath As String)
Dim iLen As Integer
iLen = WritePrivateProfileString(nApp, nKey, nValue, nFilePath)
End Sub
Getini("ConnStr","ServerPath_1 ","","你的ini文件路径")