how to connect to database
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
I want to connect to database with a variable name,,,,,,,,,,,,(test=database name),,,,,,,,,(a(variable)=test),,,,,,,conn=database('test','','')is the method to connect right,,,,,but i want to connect using variable name,,, conn=database('a','',''),,,,because everytimr my datase file will be selected by user,,,,
댓글 수: 1
Arun Badigannavar
2012년 11월 22일
답변 (1개)
Titus Edelhofer
2012년 11월 22일
Hi,
the question is not really clear. Do you mean the following?
a = 'test'; % input from user, e.g., by GUI or input
% use the variable a as database name:
d = database(a, ...);
This works fine as long as the user passes a "known" database name ...
Titus
댓글 수: 3
Arun Badigannavar
2012년 11월 23일
Titus Edelhofer
2012년 11월 23일
The tables are specified when you read data, e.g.
tableName = 'customers';
curs = exec(['SELECT * FROM ' tableName]);
Titus
Arun Badigannavar
2012년 11월 23일
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!