Browse with SQL server 2005
Moderator: Rathinagiri
Browse with SQL server 2005
Greetings to all. I was trying to access SQL Server 2005, with the following connection string:
CnAdo := CreateObject("ADODB.Connection")
CnAdo:Open("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Data Source=CART-1BE1F478D8\SQLEXPRESS;Initial File Name=C:\Archivos de programa\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf")
oCursor := CreateObject("ADODB.Recordset")
But the question is how do I get data from a table of SQL Server 2005 are shown in a browser?
Thank you.
CnAdo := CreateObject("ADODB.Connection")
CnAdo:Open("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Data Source=CART-1BE1F478D8\SQLEXPRESS;Initial File Name=C:\Archivos de programa\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf")
oCursor := CreateObject("ADODB.Recordset")
But the question is how do I get data from a table of SQL Server 2005 are shown in a browser?
Thank you.
- luisvasquezcl
- Posts: 1258
- Joined: Thu Jul 31, 2008 3:23 am
- Location: Chile
- Contact:
Re: Browse with SQL server 2005
Hi Cartago,
The only solution is to use one you have to upload the data grid.
best regards,
Luis Vasquez
The only solution is to use one you have to upload the data grid.
best regards,
Luis Vasquez
Re: Browse with SQL server 2005
Hi, luisvasquezcl.
Then, save the query in an array and the array is showing the browse/grid?
Many thanks.
Then, save the query in an array and the array is showing the browse/grid?
Many thanks.
Re: Browse with SQL server 2005
Hi!
Can you put any working example how to browse and update data from MS SQL Server?
Marek
Can you put any working example how to browse and update data from MS SQL Server?
Marek
- luisvasquezcl
- Posts: 1258
- Joined: Thu Jul 31, 2008 3:23 am
- Location: Chile
- Contact:
Re: Browse with SQL server 2005
Hi Marek,
#include 'minigui.ch'
#include 'adodb.ch'
Definition of the main window
Procedure Main
Local oConnection := TOleauto():New('ADODB.Connection')
Local oSql := TOleauto():New('ADODB.Recordset')
oConexion:ConnectionString ='Provider=Microsoft.Jet.OLEDB.4.0;'+;
'Data Source=MyTable.mdb;'+;
'User Id=Admin;'+;
"Password=;"
oConexion:Open()
oSql:CursorLocation = adUseClient
oSql:Open( "Select * From Client", oConnection, adOpenDynamic, adLockOptimistic )
if oSql:State = adStateClose
Msgstop('Error open table')
Endif
DEFINE WINDOW form1 .... etc... MAIN On Init LoadData(oSql)
DEFINE GRID grid_1
ROW 0
COL 0
etc....
END GRID
END WINDOW
form1.activate
Return
assuming you have a table name and phone fields have the following functions to load data:
Procedure LoadData( oSql )
form1.grid_1.deleteallitems
do while !oSql:eof()
form1.grid_1.additem( { oSql:fields(0):Value, oSql:Fields(1):Value } )
oSql:MoveNext()
enddo
return
you can change the fields position with fieldsname for example:
form1.grid_1.additem( { oSql:Fields('Name'):Value, oSql:Fields('Phone'):Value } )
I hope you will be useful
regards
Luis Vasquez
#include 'minigui.ch'
#include 'adodb.ch'
Definition of the main window
Procedure Main
Local oConnection := TOleauto():New('ADODB.Connection')
Local oSql := TOleauto():New('ADODB.Recordset')
oConexion:ConnectionString ='Provider=Microsoft.Jet.OLEDB.4.0;'+;
'Data Source=MyTable.mdb;'+;
'User Id=Admin;'+;
"Password=;"
oConexion:Open()
oSql:CursorLocation = adUseClient
oSql:Open( "Select * From Client", oConnection, adOpenDynamic, adLockOptimistic )
if oSql:State = adStateClose
Msgstop('Error open table')
Endif
DEFINE WINDOW form1 .... etc... MAIN On Init LoadData(oSql)
DEFINE GRID grid_1
ROW 0
COL 0
etc....
END GRID
END WINDOW
form1.activate
Return
assuming you have a table name and phone fields have the following functions to load data:
Procedure LoadData( oSql )
form1.grid_1.deleteallitems
do while !oSql:eof()
form1.grid_1.additem( { oSql:fields(0):Value, oSql:Fields(1):Value } )
oSql:MoveNext()
enddo
return
you can change the fields position with fieldsname for example:
form1.grid_1.additem( { oSql:Fields('Name'):Value, oSql:Fields('Phone'):Value } )
I hope you will be useful
regards
Luis Vasquez
Re: Browse with SQL server 2005
many thanks Luis.
I will test it if I find some free time.
I need to move my one database to Oracle, and I don't know how to do it...
best regards, Marek
I will test it if I find some free time.
I need to move my one database to Oracle, and I don't know how to do it...
best regards, Marek
- luisvasquezcl
- Posts: 1258
- Joined: Thu Jul 31, 2008 3:23 am
- Location: Chile
- Contact:
Re: Browse with SQL server 2005
Hi Marek.
on page www.connectionstrings.com exist there is a way to connect to an Oracle or other database.
regards,
Luis Vasquez
on page www.connectionstrings.com exist there is a way to connect to an Oracle or other database.
regards,
Luis Vasquez
Re: Browse with SQL server 2005
How to update changed data to database?
Marek
Marek
Re: Browse with SQL server 2005
Hello, Marek.
With regard to the connection strings if you want to do it fast, you can use a udl file extension, which works as an assistant. You can also switch to Oracle.
You said how:
http://msdn.microsoft.com/en-us/library ... S.71).aspx
Once you create the connection you want to go back to the txt file, open it and copy the last line, which is the connection string.
Regards.
P.S.: Excuse my poor English.
With regard to the connection strings if you want to do it fast, you can use a udl file extension, which works as an assistant. You can also switch to Oracle.
You said how:
http://msdn.microsoft.com/en-us/library ... S.71).aspx
Once you create the connection you want to go back to the txt file, open it and copy the last line, which is the connection string.
Regards.
P.S.: Excuse my poor English.
- Ismach
- Posts: 161
- Joined: Wed Nov 28, 2012 5:55 pm
- DBs Used: DBF, mySQL, Mariadb, postgreSQL, Oracle, Db2, Interbase, Firebird, and SQLite
- Location: Buenos Aires - Argentina
Re: Browse with SQL server 2005
amigos Si quieren conectar ORACLE vean el posting ==> http://www.hmgforum.com/viewtopic.php?f=14&t=4362