In order to investigate the relationship between the flux pinning and dimensionality, the critical current density J_c for YBa_2Cu_3O_7 films was measured as a function of temperature, field and tilt angle between field and c-axis. The kink anomaly in the temperature dependence of J_c for B⊥c was observed as the dimensional crossover from 3D extrinsic pinning to 2D intrinsic pinning. The irreversibility field B_i for B//c was measured in fields up to 23T and estimated to be 90T at 30K using the scaling law of the pinning force densities. The enhancement of B_i from a power law (1-T/T_c)^n with n≈1.5 for B//c was observed below 40K. This suggests the formation of the 2-dimensional pancake vortex in YBa_2Cu_3O_7