怎么查看本地数据库

怎么查看本地数据库,第1张

问题一:怎么打开本地搭建的数据库 首先你打开mysql数据库的界面后,在指令中输入create database就行了,如果你还对T-SQL语句不够了解的话,建议先学习一下sql2005,它是很容易入门的,mysql在无可视化工具下,完全靠的是程序员对sql语句的了解,就比如在dos和window两种 *** 作系统,window就比较容易入门,但dos是对你的能力的提升和对自己的自信!

问题二:本地数据库时什么?怎么找到??? 本地数据库就是和调用程序同在一台电脑上的数据库。

远程数据库,需要网络远程链接,于调用程序不在同一台电脑上。

你是要找到本地数据库的文件?还是要链接本地数据库?

如果是程序要链接数据库,一般是 需要 数据库地址,数据库名,数据库帐号,数据库密码

本地的就填写 localhost 为数据库地址,远程的就填写 IP地址

如果需要找到本地的数据库文件,需要查看数据库的设置,得到路径。

问题三:oracle怎么查看本地数据库 只能看到加密后的密码:select username,password from dba_users

问题四:安卓已有的项目如何查看本地数据库 提供一个思路:

在点击注册按钮之后,触发一个查重函数:

传递进去的参数为提交的用户名,

使用sql语句在SQLite数据库中查询是否存在该用户名,

返回是否存在。

大致函数:

public boolean hasUser(String user_name){

Boolean b=false

Cursor cursor=db.query(User, null, user_name = + user_name, null, null, null,null)

b=cursor.moveToFirst()

Log.e(---HaveUser---,b.toString())

cursor.close()

return b

}

希望能对您有帮助!

问题五:如何查看本地oracle数据库 只能看到加密后的密码:select username,password from dba_users

问题六:怎么启动本地的mysql数据库 windows下:

打开命令行窗口(cmd),如果安装的Mysql服务名为mysql,则net start mysql(此步也可直接在控制面板->管理->服务中启动Mysql)

输入命令进入到Mysql的安装目录中的bin目录内,如安装目录为c:\program files\Mysql,则输入命令cd c:\program files\Mysql\bin;

使用命令启动mysql服务,如用户名为root密码为123456,则命令mysql -u root -p 123456;如果登录成功,则说明mysql服务启动成功。

Linux下:

直接在命令行窗口中service mysql start(假设服务名称为mysql)

然后按windows下的第2和第3步进行同样验证;

问题七:怎么用SQLServer访问本地数据库 20分 右键点我的电脑

选择“管理”

进“服务和应用程序”――服务

任意选择一个服务,然后按M快速定位,找到MSSQLSERVER

然后双击

然后切换到登录,然后修改登录身份为本地系统账户

重启电脑(注销如果不行的话)

问题八:oracle怎么打开本地数据库 开始菜单里找到它,配置好后,可以用PL/SQL登录;

或者直接打开SQL PLUS,输入用户名、密码登录。

问题九:怎么查看oracle数据库名字, :\oracle\product\10.2.0\db_1\NETWORK\ADMIN\tnsnames.ora

打开这个文件tnsnames.ora,里面能看到

问题十:如何查看本地oracle数据库用户名和密码 只能看到加密后的密码:select username,password from dba_users

1.提取单条记录

/*

#import "c:\Program Files\Common Files\System\ADO\msado15.dll" \

no_namespace rename("EOF", "EndOfFile")

*/

CoInitialize(NULL)

_bstr_t varSource="Provider=Microsoft.Jet.OLEDB.4.0Data Source=*.mdb"

//_bstr_t varSource="Data Source=myServerAddressInitial Catalog=myDataBaseUser Id=myUsernamePassword=myPassword"

_ConnectionPtr m_pConnection(_uuidof(Connection))

m_pConnection->Open(varSource,"","",adModeUnknow)

_RecordsetPtr m_pSet(_uuid(Recordset))

try {

m_pSet->Open(%%1,m_pConnection.GetInterfacePtr()

adOpenDynamic,adLockPessimistic,adCmdText)

}

catch(_com_error *e){

{

AfxMessageBox(e->ErrorMessage())

return

}

_variant_t var

CString %%2=""

long fldc=m_pSet->GetFields()->GetCount()

long i=0

try {

m_pSet->MoveFirst()

if(!m_pSet->adoEOF)

{

for(i=0i<fldci++)

{

var=m_pSet->GetCollect((long)i)

var.ChangeType(VT_BSTR)

%%2+=var.bstrVal

%%2+=" "

}

//m_pSet->MoveNext()

}

}

catch(_com_error *e){

AfxMessageBox(e->ErrorMessage())

delete e

}

//m_pSet->MoveFirst()

CoUninitialize(NULL)

3.显示表格

/*

#import "c:\Program Files\Common Files\System\ADO\msado15.dll" \

no_namespace rename("EOF", "EndOfFile")

*/

CoInitialize(NULL)

_bstr_t varSource="Provider=Microsoft.Jet.OLEDB.4.0Data Source=*.mdb"

//_bstr_t varSource="Data Source=myServerAddressInitial Catalog=myDataBaseUser Id=myUsernamePassword=myPassword"

_ConnectionPtr m_pConnection(_uuidof(Connection))

m_pConnection->Open(varSource,"","",adModeUnknow)

//打开属性为默认(adModeRead(只读),adModeWrite(可写),adModeReadWrite(可读写)等)

_RecordsetPtr m_pSet(_uuid(Recordset))

try {

HRESULT hr=m_pSet->Open(%%1,m_pConnection.GetInterfacePtr(),

adOpenDynamic,adLockPessimistic,adCmdText)

}

catch(_com_error *e){

AfxMessageBox(e->ErrorMessage())

}

if(SUCCESSED(hr))

{

//表打开成功

}

FieldsPtr p_fields=m_pSet->Fields

FieldPtr p_field

_variant_t var_index

LPCSTR field_name

int index=0

_bstr_t bstr_field_name

int countfields=p_fields->GetCount()

CString *Column=new CString[countfields]

CListCtrl *pList=(CListCtrl*)GetDlgItem(%%1)//IDC_LIST_TABLEDATA

VERIFY(pList)

pList->DeleteAllItems()

for(index=0index<countfieldsindex++)

{

var_index.vt=VT_I4

var_index.IVal=index

p_field=p_fields->Item[var_index]

bstr_field_name=p_field->GetName()

field_name=(LPCSTR)bstr_field_name

Column[index]=field_name

int ColumnWidth=Column[index].GetLength()*15

pList->InsertColumn(index,field_name,LVCFMT_CENTER,ColumnWidth)

}

int i=0

_bstr_t vCol

//pList->SetTextBkColor(RGB(122,200,122))

//pList->SetTextColor(RGB(0,0,200))

while(!m_pSet->adoEOF)

{

pList->Insert(i,atoi(i))

for(int j=0j<countfieldsj++)

{

vCol=m_pSet->GetCollect((long)j)

pList->SetItemText(i,j,vCol)

}

m_pSet->MoveNext()

i++

}

CoUninitialize(NULL)

4. *** 作表格

/*

#import "c:\Program Files\Common Files\System\ADO\msado15.dll" \

no_namespace rename("EOF", "EndOfFile")

*/

CoInitialize(NULL)

_bstr_t varSource="Provider=Microsoft.Jet.OLEDB.4.0Data Source=*.mdb"

//_bstr_t varSource="Data Source=myServerAddressInitial Catalog=myDataBaseUser Id=myUsernamePassword=myPassword"

_ConnectionPtr m_pConnection(_uuidof(Connection))

m_pConnection->Open(varSource,"","",adModeUnknow)

//打开属性为默认(adModeRead(只读),adModeWrite(可写),adModeReadWrite(可读写)等)

_RecordsetPtr m_pSet(_uuid(Recordset))

try {

HRESULT hr=m_pSet->Open(%%1,m_pConnection.GetInterfacePtr(),

adOpenDynamic,adLockPessimistic,adCmdText)

}

catch(_com_error *e){

AfxMessageBox(e->ErrorMessage())

}

if(SUCCESSED(hr))

{

//表打开成功

}

FieldsPtr p_fields=m_pSet->Fields

FieldPtr p_field

_variant_t var_index

LPCSTR field_name

int index=0

_bstr_t bstr_field_name

int countfields=p_fields->GetCount()

CString *Column=new CString[countfields]

CListCtrl *pList=(CListCtrl*)GetDlgItem(%%1)//IDC_LIST_TABLEDATA

VERIFY(pList)

pList->DeleteAllItems()

for(index=0index<countfieldsindex++)

{

var_index.vt=VT_I4

var_index.IVal=index

p_field=p_fields->Item[var_index]

bstr_field_name=p_field->GetName()

field_name=(LPCSTR)bstr_field_name

Column[index]=field_name

int ColumnWidth=Column[index].GetLength()*15

pList->InsertColumn(index,field_name,LVCFMT_CENTER,ColumnWidth)

}

int i=0

_bstr_t vCol

//pList->SetTextBkColor(RGB(122,200,122))

//pList->SetTextColor(RGB(0,0,200))

while(!m_pSet->adoEOF)

{

pList->Insert(i,atoi(i))

for(int j=0j<countfieldsj++)

{

vCol=m_pSet->GetCollect((long)j)

pList->SetItemText(i,j,vCol)

}

m_pSet->MoveNext()

i++

}

CoUninitialize(NULL)

5.数值范围查询

/*

#import "c:\Program Files\Common Files\System\ADO\msado15.dll" \

no_namespace rename("EOF", "EndOfFile")

*/

try

{

//创建连接对象实例

m_pConnection.CreateInstance("ADODB.Connection")

//设置连接字符串

CString strConnect="DRIVER={Microsoft Access Driver (*.mdb)}\

uid=pwd=DBQ=shujuku.mdb"

//使用Open方法连接数据库

m_pConnection->Open((_bstr_t)strConnect,"","",adModeUnknown)

}

catch(_com_error e)

{

AfxMessageBox(e.Description())

}

}

try {

int min = %%1

int max = %%2

CString sql

sql.Format("select count(*) as pro_count from ProPrice where price between %d and %d",min,max)

HRESULT hr=m_pSet->Open(sql,m_pConnection.GetInterfacePtr(),

adOpenDynamic,adLockPessimistic,adCmdText)

}

catch(_com_error *e){

AfxMessageBox(e->ErrorMessage())

}

if(SUCCESSED(hr))

{

//表打开成功

}

FieldsPtr p_fields=m_pSet->Fields

FieldPtr p_field

_variant_t var_index

LPCSTR field_name

int index=0

_bstr_t bstr_field_name

int countfields=p_fields->GetCount()

CString *Column=new CString[countfields]

CListCtrl *pList=(CListCtrl*)GetDlgItem(%%1)//IDC_LIST_TABLEDATA

VERIFY(pList)

pList->DeleteAllItems()

for(index=0index<countfieldsindex++)

{

var_index.vt=VT_I4

var_index.IVal=index

p_field=p_fields->Item[var_index]

bstr_field_name=p_field->GetName()

field_name=(LPCSTR)bstr_field_name

Column[index]=field_name

int ColumnWidth=Column[index].GetLength()*15

pList->InsertColumn(index,field_name,LVCFMT_CENTER,ColumnWidth)

}


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/sjk/10040056.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-04
下一篇2023-05-04

发表评论

登录后才能评论

评论列表(0条)

    保存