예제 #1
0
파일: data.go 프로젝트: enderlu/vfp
//Terminates a connection to a data source.
func SqlDisConnect(conn *odbc.Connection) {

	zr, ok := GStatementPerConnection[conn]
	if ok {
		for _, zstmt := range zr {
			zstmt.Close()
		}
	} else {
		panic("Connection is invalid")
	}

	conn.Close()
}
예제 #2
0
파일: data.go 프로젝트: enderlu/vfp
//Prepares a SQL statement for remote execution by SQLEXEC( ).
func SqlPrepare(zconn *odbc.Connection, zselect string, zcursor string) (*odbc.Statement, *odbc.ODBCError) {
	zstmt, zerr := zconn.Prepare(zselect)
	GPrepareMapCursor[zstmt] = zcursor
	GStatementPerConnection[zconn] = append(GStatementPerConnection[zconn], zstmt)
	return zstmt, zerr
}