Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database Checkpoint
#2
Not Solved
A Database check would be dependant on what you need to check.... is it the number of records being returned or the actual field name values?

What database are you connecting to? for examples of connection strings see: http://www.connectionstrings.com/

I have a control file that the Parameters are passed from I'm connecting to three different databases depending which on is switched on the control file on my test box.

Code:
DBType=GetLocalParameter("profile.database")  
If DBType="Oracle" Then
  UID = GetLocalParameter("oracle.user")
  PWD = GetLocalParameter("oracle.password")
  SERVER= GetLocalParameter("oracle.servername")
  set conn=Createobject("ADODB.Connection")
  Srvname="DRIVER={Microsoft ODBC for Oracle};UID="&UID&";PWD="&PWD&";SERVER="&SERVER&";"
  conn.open Srvname
Elseif DBType="sqlserver" Then
  UID = GetLocalParameter("sqlserver.user")
  PWD = GetLocalParameter("sqlserver.password")
  SERVER= GetLocalParameter("sqlserver.servername")
  DATABASE= GetLocalParameter("sqlserver.servername")
  DATASOURCE=GetLocalParameter("sqlserver.host")
  PORTNUM=GetLocalParameter("sqlserver.port")
  set conn=Createobject("ADODB.Connection")
  Srvname= "PROVIDER=SQLOLEDB;DATA SOURCE="&DATASOURCE&","&PORTNUM&";UID="&UID & ";PWD="&PWD&";DATABASE="
  conn.open Srvname
Elseif DBType="isam" Then
DATASOURCE=GetLocalParameter("isam.datasource")
set conn=Createobject("ADODB.Connection")
    Srvname="Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq="&DATASOURCE&"; "
msgbox(Srvname)
conn.open Srvname
End If

Once you have opened the connection to the server all you need to do is run the SQL query:

Code:
Set Rec = CreateObject("ADODB.Recordset")
SQL= ""&sqlstring&" "
Rec.open SQL ,conn


for me I'm just verifying the number of records being returned so my "sqlstring" is being built in another process and as it only returns the count you can put the count in a variable as below

Code:
Total_Count=rec(0)


Then you can do a compare with you database count and the number of records displayed on your Application..
Reply


Messages In This Thread
Database Checkpoint - by amilar - 01-13-2009, 12:03 PM
RE: Database Checkpoint - by Jackomcnabb - 01-20-2009, 12:18 AM
RE: Database Checkpoint - by amilar - 01-20-2009, 04:32 PM
RE: Database Checkpoint - by Jackomcnabb - 01-20-2009, 09:33 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Database CheckPoint Luanna 1 1,931 01-21-2014, 02:27 PM
Last Post: Luanna
  How do I create a database checkpoint to validate data from xls NewAtQTP 0 2,534 02-25-2011, 05:18 PM
Last Post: NewAtQTP
Wink standard checkpoint and text checkpoint kiran10_rm 1 5,363 11-18-2010, 05:16 AM
Last Post: nandu
  fullscreen and bitmap checkpoint error "Cannot create bitmap checkpoint" meuline 2 4,722 12-10-2009, 09:17 PM
Last Post: meuline
  Checkpoint problems: Checkpoint starts before web page is loaded & therefore fails! IdontGetIt 1 3,921 11-20-2009, 11:45 AM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 1 Guest(s)